Session Ready
Exercise

Adapting to different input columns

In the previous two exercises, you explicitly passed in the exact column to target. But now that you're feeling a bit more comfortable manipulating data.tables, let's do something really fun.

Given just a data.table, let's dynamically select a column and then do something to it.

Instructions
100 XP
  • When add_square_features() creates a new column, it should name the new column by appending "_squared" to the name of the original column.
  • For each selected column, add_square_features() should produce one new column that holds that original column's values squared.
  • Add squared features for all the numeric columns in diagnosticDT