Skip to content
C

Train/Test Split and Linear Regression

Easypython

Using the notes' own hours-studied-vs-exam-scores dataset, split it with traintestsplit, train a LinearRegression model, and predict the score for a given number of study hours.

Approach: use the exact dataset, testsize, and randomstate from the notes so the split is reproducible, fit a LinearRegression, then predict for the given hours value.

Input: One line: the number of hours studied to predict a score for.

Output: One line: the predicted exam score, to 2 decimal places.

Input (stdin)

Output

Run your code to see output here...