Model {agghoo} | R Documentation |
"Model" class, containing a (generic) learning function, which from data + target [+ params] returns a prediction function X –> y. Parameters for cross-validation are either provided or estimated. Model family can be chosen among "tree", "ppr" and "knn" for now.
nmodels
Number of parameters (= number of [predictive] models)
new()
Create a new generic model.
Model$new(data, target, task, gmodel = NULL, params = NULL)
data
Matrix or data.frame
target
Vector of targets (generally numeric or factor)
task
"regression" or "classification"
gmodel
Generic model returning a predictive function; chosen automatically given data and target nature if not provided.
params
List of parameters for cross-validation (each defining a model)
get()
Returns the model at index "index", trained on dataHO/targetHO.
Model$get(dataHO, targetHO, index)
dataHO
Matrix or data.frame
targetHO
Vector of targets (generally numeric or factor)
index
Index of the model in 1...nmodels
getParam()
Returns the parameter at index "index".
Model$getParam(index)
index
Index of the model in 1...nmodels
clone()
The objects of this class are cloneable with this method.
Model$clone(deep = FALSE)
deep
Whether to make a deep clone.