A music teacher logged how many hours each student practised (hours) and their exam mark (marks). A new student asks: how many hours should I practise to be predicted a mark of target?
Write hours_for_mark(hours, marks, target).
LinearRegression model with hours as the only feature.mark = coef_ * hours + intercept_. Find the number of hours where this line equals target.The fitted slope is never zero in the tests. The answer may be outside the range of hours in the data, or even negative. Return it anyway.