MonteCarlo-class {performanceEstimation} | R Documentation |
Class "MonteCarlo"
Description
This class of objects contains the information describing a monte carlo experiment, i.e. its settings.
Objects from the Class
Objects can be created by calls of the form MonteCarlo(...)
providing the values for the class slots.
These objects contain information on the number of repetitions of the
experiments, the data used for training the models on each repetition,
the data used for testing these models, the random number
generator seed and optionally the
concrete data splits to use on each iteration of the Monte Carlo
experiment. Note that most of the times you will not supply these data
splits as the Monte Carlo routines in this infra-structure will take care of
building them. Still, this allows you to replicate some experiment
carried out with specific train/test splits.
Slots
nReps
:Object of class
numeric
indicating the number of repetitions of the Monte Carlo experiment (defaulting to 10).szTrain
:Object of class
numeric
. If it is a value between 0 and 1 it is interpreted as a percentage of the available data set, otherwise it is interpreted as the number of cases to use. It defaults to 0.25.szTest
:Object of class
numeric
If it is a value between 0 and 1 it is interpreted as a percentage of the available data set, otherwise it is interpreted as the number of cases to use. It defaults to 0.25.seed
:Object of class
numeric
with the random number generator seed (defaulting to 1234).dataSplits
:Object of class
list
containing the data splits to use on each Monte Carlo repetition. Each element should be a list with two components:test
andtrain
, on this order. Each of these is a vector with the row ids to use as test and train sets of each repetition of the Monte Carlo experiment.
Extends
Class EstCommon
, directly.
Class EstimationMethod
, directly.
Methods
- show
signature(object = "MonteCarlo")
: method used to show the contents of aMonteCarlo
object.
Author(s)
Luis Torgo ltorgo@dcc.fc.up.pt
References
Torgo, L. (2014) An Infra-Structure for Performance Estimation and Experimental Comparison of Predictive Models in R. arXiv:1412.0436 [cs.MS] http://arxiv.org/abs/1412.0436
See Also
LOOCV
,
CV
,
Bootstrap
,
Holdout
,
EstimationMethod
,
EstimationTask
Examples
showClass("MonteCarlo")
m1 <- MonteCarlo(nReps=10,szTrain=0.3,szTest=0.2)
m1
## Small example illustrating the format of user supplied data splits
## it assumes that the source data is formed by 10 cases and that each
## model is trainined with 3 cases and tested in the following case.
## This is obviously a unrealistic example in terms of size but
## illustrates the format of the data splits
m2 <- MonteCarlo(dataSplits=list(list(test=sample(1:150,50),train=sample(1:150,50)),
list(test=sample(1:150,50),train=sample(1:150,50)),
list(test=sample(1:150,50),train=sample(1:150,50))
))
m2