January 2020
Beginner to intermediate
372 pages
10h
English
Let's visualize the relationship of the polynomial variables with the target. First, let's run the main recipe as indicated in step 1 to step 8. Then, let's import the Python visualization library and make the plots:
import matplotlib.pyplot as plt
def plot_features(df, target): nb_rows = 5 nb_cols = 4 fig, axs = plt.subplots(nb_rows, nb_cols, figsize=(12, 12)) plt.subplots_adjust(wspace=None, hspace=0.4) n = 0 for i in range(0, nb_rows): for j in range(0, nb_cols): if n!=19: axs[i, j].scatter(df[df.columns[n]], target) axs[i, j].set_title(df.columns[n]) n += 1
Read now
Unlock full access