Session Ready
Exercise

Class method

The pair_plot() method we defined in the previous exercise facilitates exploratory data analysis.

If we have several datasets that we want to explore, it can be tedious to instantiate the ScikitData class repeatedly.

To enable rapid instantiation of our ScikitData class, we will add a class method called get_generator().

A class method is a good choice here, because we want to be able to access the class's ability to make new instances.

We will use get_generator() to create a generator named dataset_generator that will generate instances that represent the diabetes and iris datasets.

Instead of assigning the instances to variables, we will use a for loop and the pair_plot() instance method from the previous exercise to plot each dataset.

Instructions
100 XP
  • Fill in the decorator for the get_generator() class method definition.
  • Add the first parameter to the get_generator() class method definition.