ComenzarEmpieza gratis

Meaning of evolution

In this exercise you will investigate the link between the variable "donations2017min_2016" that you added to the basetable in the previous exercises and the target, using a predictor insight graph.

For your convenience, the methods to create the predictor insight graph are pre-programmed.

To plot the predictor insight graph of a continuous variable variable in a basetable, you can follow these steps:

  • Discretize the variable in n_bins bins:
basetable["variable_disc"] = pd.qcut(basetable["variable"], n_bins)
  • Construct the predictor insight graph table:
pig_table = create_pig_table(basetable, "target","variable_disc")
  • Plot the predictor insight graph based on this table:
plot_pig(pig_table,"variable_disc")

Este ejercicio forma parte del curso

Intermediate Predictive Analytics in Python

Ver curso

Instrucciones del ejercicio

  • Discretize the evolution variable donations_2017_min_2016 in 5 bins and add it to the basetable.
  • Create the predictor insight graph table for this variable.
  • Plot the predictor insight graph of this variable.

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Discretize the variable in 5 bins and add to the basetable
basetable["donations_2017_min_2016_disc"] = pd.____(____["____"], ____)

# Construct the predictor insight graph table
pig_table = ____(____, "target", "____")

# Plot the predictor insight graph
plot_pig(____, "____")
Editar y ejecutar código