FunctionRacerProblemsRace

Hold Some Back

Beginnerscikit-learnPython

A model must be tested on rows it never saw. Split the rows of X at random into a training part and a test part holding a quarter of the rows, using random_state=0 so the split can be repeated. Return the test part.

Example 1

X [[1],[2],[3],[4]]
returns [[3]]

One row of four is held back. With random_state=0 it is the third row.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More scikit-learn problems