January 2018
Beginner to intermediate
316 pages
7h 14m
English
Now we can conduct some exploratory data analysis. Since the purpose of polynomial features is to get a better sense of feature interaction in the original data, the best way to visualize this is through a correlation heatmap.
We need to import a data visualization tool that will allow us to create a heatmap:
%matplotlib inline import seaborn as sns
Matplotlib and Seaborn are popular data visualization tools. We can now visualize our correlation heatmap as follows:
sns.heatmap(pd.DataFrame(X_poly, columns=poly.get_feature_names()).corr())
.corr is a function we can call on our DataFrame that gives us a correlation matrix of our features. Let's take a look at our feature interactions:
The colors on the heatmap
Read now
Unlock full access