| AgghooCV {agghoo} | R Documentation |
R6 class with agghoo functions fit() and predict().
Description
Class encapsulating the methods to run to obtain the best predictor from the list of models (see 'Model' class).
Methods
Public methods
Method new()
Create a new AgghooCV object.
Usage
AgghooCV$new(data, target, task, gmodel, loss)
Arguments
dataMatrix or data.frame
targetVector of targets (generally numeric or factor)
task"regression" or "classification". Default: classification if target not numeric.
gmodelGeneric model returning a predictive function Default: tree if mixed data, knn/ppr otherwise.
lossFunction assessing the error of a prediction Default: error rate or mean(abs(error)).
Method fit()
Fit an agghoo model.
Usage
AgghooCV$fit(CV = NULL)
Arguments
CVList 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
Method predict()
Predict an agghoo model (after calling fit())
Usage
AgghooCV$predict(X)
Arguments
XMatrix or data.frame to predict
Method getParams()
Return the list of V best parameters (after calling fit())
Usage
AgghooCV$getParams()
Method clone()
The objects of this class are cloneable with this method.
Usage
AgghooCV$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.