fstermann / mlr-mini

MIT License
0 stars 2 forks source link

Create Models predict generic #21

Closed fstermann closed 1 year ago

fstermann commented 1 year ago

7

Create the generic for predict.

Example code and output:

predict(model.xgb, newdata = data.frame(speed = 10))
#> [1] 23.76096

prediction <- predict(model.xgb, newdata = cars.data[c(1, 2, 3, 4), ])

prediction
#>    prediction truth
#> 1:   5.710046     2
#> 2:   5.710046    10
#> 3:  12.451396     4
#> 4:  12.451396    22