View source: R/predictLearner.R
predictLearner | R Documentation |
Mainly for internal use. Predict new data with a fitted model. You have to implement this method if you want to add another learner to this package.
predictLearner(.learner, .model, .newdata, ...)
.learner |
(RLearner) |
.model |
(WrappedModel) |
.newdata |
(data.frame) |
... |
(any) |
Your implementation must adhere to the following:
Predictions for the observations in .newdata
must be made based on the fitted
model (.model$learner.model
).
All parameters in ...
must be passed to the underlying predict function.
For classification: Either a factor with class labels for type “response” or, if the learner supports this, a matrix of class probabilities for type “prob”. In the latter case the columns must be named with the class labels.
For regression: Either a numeric vector for type “response” or, if the learner supports this, a matrix with two columns for type “se”. In the latter case the first column contains the estimated response (mean value) and the second column the estimated standard errors.
For survival: Either a numeric vector with some sort of orderable risk for type “response” or, if supported, a numeric vector with time dependent probabilities for type “prob”.
For clustering: Either an integer with cluster IDs for type “response” or, if supported, a matrix of membership probabilities for type “prob”.
For multilabel: A logical matrix that indicates predicted class labels for type “response” or, if supported, a matrix of class probabilities for type “prob”. The columns must be named with the class labels.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.