January 2020
Beginner to intermediate
372 pages
10h
English
We can create visualizations to understand whether the derived feature shows the desired monotonic relationship as well as its distribution. After we run all of the steps in the How to do it... section of this recipe, we can create a simple scatter plot as follows:
import matplotlib.pyplot as plt
plt.scatter(X_test['new_feat'], y_test)plt.ylabel('MEDV')plt.xlabel('new_feat')plt.title('Tree derived feature vs House Price')
The preceding code block outputs the following plot, where you can see the monotonic relationship between the newly created feature and the target:
In the scatter plot, we can see a fairly decent ...
Read now
Unlock full access