AgghooCV {agghoo} | R Documentation |
Class encapsulating the methods to run to obtain the best predictor from the list of models (see 'Model' class).
new()
Create a new AgghooCV object.
AgghooCV$new(data, target, task, gmodel, loss)
data
Matrix or data.frame
target
Vector of targets (generally numeric or factor)
task
"regression" or "classification". Default: classification if target not numeric.
gmodel
Generic model returning a predictive function Default: tree if mixed data, knn/ppr otherwise.
loss
Function assessing the error of a prediction Default: error rate or mean(abs(error)).
fit()
Fit an agghoo model.
AgghooCV$fit(CV = NULL)
CV
List describing cross-validation to run. Slots:
- type: 'vfold' or 'MC' for Monte-Carlo (default: MC)
- V: number of runs (default: 10)
- test_size: percentage of data in the test dataset, for MC
(irrelevant for V-fold). Default: 0.2.
- shuffle: wether or not to shuffle data before V-fold.
Irrelevant for Monte-Carlo; default: TRUE
Default (if NULL): type="MC", V=10, test_size=0.2
predict()
Predict an agghoo model (after calling fit())
AgghooCV$predict(X)
X
Matrix or data.frame to predict
getParams()
Return the list of V best parameters (after calling fit())
AgghooCV$getParams()
clone()
The objects of this class are cloneable with this method.
AgghooCV$clone(deep = FALSE)
deep
Whether to make a deep clone.