1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Learning for Finance in Python

Connected

Exercise

Examine correlations of the new features

Now that we have our volume and datetime features, we want to check the correlations between our new features (stored in the new_features list) and the target (5d_close_future_pct) to see how strongly they are related. Recall pandas has the built-in .corr() method for DataFrames, and seaborn has a nice heatmap() function to show the correlations.

Instructions

100 XP
  • Extend our new_features variable to contain the weekdays' column names, such as weekday_1, by concatenating the weekday number with the 'weekday_' string.
  • Use Seaborn's heatmap to plot the correlations of new_features and the target, 5d_close_future_pct.