Aan de slagGa gratis aan de slag

Exploring the base table

Before diving into model building, it is important to understand the data you are working with. In this exercise, you will learn how to obtain the population size, number of targets and target incidence from a given basetable.

Deze oefening maakt deel uit van de cursus

Introduction to Predictive Analytics in Python

Cursus bekijken

Oefeninstructies

  • The basetable is loaded in a pandas object basetable. Assign the number of rows to the variable population_size and print it.
  • Assign the number of targets equal to one to the variable targets_count and print it.
  • Print the target incidence, this is the ratio of targets_count and population_size.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Assign the number of rows in the basetable to the variable 'population_size'.
population_size  = ____(____)

# Print the population size.
print(____)

# Assign the number of targets to the variable 'targets_count'.
targets_count = ____(____[____])

# Print the number of targets.
print(____)

# Print the target incidence.
print(____ / ____)
Code bewerken en uitvoeren