FunctionRacerProblemsRace

Prices for New Rows

EasystatsmodelsPython

train has columns size, age and price. new has only size and age. Fit price on size and age using train, and return the predicted price of every row of new.

Example 1

train {"size":[0,1,0,1,2],"age":[0,0,1,1,2],"price":[1,3,6,8,15]}
new {"size":[3,0],"age":[0,4]}
returns [7.0,21.0]

The training prices follow 1 + 2 * size + 5 * age, so the new rows come to 7 and 21.

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 statsmodels problems