| ml_make_model | R Documentation |
Returns a pair of closures fit(X,y) / predict(model, X) implementing
a chosen learner. Implementations are NA-aware and conservative:
glmnet ridge drops rows with any non-finite input; ranger and xgboost
keep NA in X as missing; the linear baseline uses lm.fit.
ml_make_model(
type = c("ridge", "rf", "xgboost", "linear"),
params = list(),
nrounds = 200L,
...
)
type |
One of |
params |
List of model parameters (passed to backend; used by xgboost). |
nrounds |
Integer boosting rounds (xgboost). |
... |
Additional arguments forwarded to the backend. |
Optional dependencies: glmnet (ridge), ranger (rf), xgboost (xgboost).
If a backend is not available, use "linear" or install the package.
A list with functions fit and predict.
## Not run:
ridge <- ml_make_model("ridge")
m <- ridge$fit(X_is, y_is)
s <- ridge$predict(m, X_oos)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.