1.1.5 Predicting🔗ℹ

predict reads new data by the predictors’ names, in any column order. Predict a car of 3,000 pounds and 150 horsepower:

> (define new-car '((wt 3.0) (hp 150)))
> (predict fit new-car)

'(20.82783890103707)

> (predict named-fit new-car)

'(20.34936777625186)

> (predict cv new-car)

'(20.704304273758567)

The penalized predictions, the lasso’s and cv’s at lambda-1se, are pulled toward the mean fuel economy. A classifier’s #:type chooses its linear predictor, probabilities or classes; see Predictions and coefficients.