Session Ready
Exercise

Instance method

In this exercise, we will work with a class called ScikitData that represents datasets from the popular Python machine learning library scikit-learn.

ScikitData has already been defined. In this exercise, we will define an instance method called pair_plot() and add it to ScikitData.

It is best practice to include all methods in the class definition, but we will add methods to ScikitData on the fly, so that we can build the class sequentially without redefining it.

Our pair_plot() instance method will plot dataset variables against each other using the pairplot() function, which has already been imported from the seaborn library.

Before we can use pair_plot() to make a scatterplot matrix, we will have to create a ScikitData instance.

Instructions
100 XP
  • Fill in the first parameter in the pair_plot() instance method definition.
  • Create the diabetes instance of the ScikitData class.