LessonΒ·difficulty 2/5Β·~15 min
Scale a feature column
Implement scale_features(values).
values is a list of finite numbers. Return min-max scaled values. Empty input returns []; a constant column returns a list of zeros of the same length. In a real ML pipeline, fit parameters on training data and reuse them; this exercise fits one supplied training column.
Before coding, predict one result by hand. After the tests pass, explain your approach and add a boundary example of your own.
Tests
- Case 1
- Case 2
- Case 3
- Case 4
β¦ Stuck? Ask for a spark
Sign in or create a free account to use your monthly AI explainer allowance.
warming up
Loading editorβ¦
Consolewaiting
$ Console output will appear here.