Parameters for Data Modelling Specification
ModellingParams-class.Rd
Collects and checks necessary parameters required for data modelling. Apart from data transfomation that needs to be done within cross-validation (e.g. subtracting each observation from training set mean), feature selection, model training and prediction, this container also stores a setting for class imbalance rebalancing.
Usage
ModellingParams(
balancing = c("downsample", "upsample", "none"),
transformParams = NULL,
selectParams = SelectParams("t-test"),
trainParams = TrainParams("DLDA"),
predictParams = PredictParams("DLDA"),
doImportance = FALSE
)
Arguments
- balancing
Default:
"downsample"
. A character value specifying what kind of class balancing to do, if any.- transformParams
Parameters used for feature transformation inside of C.V. specified by a
TransformParams
instance. Optional, can beNULL
.- selectParams
Parameters used during feature selection specified by a
SelectParams
instance. By default, parameters for selection based on differences in means of numeric data. Optional, can beNULL
.- trainParams
Parameters for model training specified by a
TrainParams
instance. By default, uses diagonal LDA.- predictParams
Parameters for model training specified by a
PredictParams
instance. By default, uses diagonal LDA.- doImportance
Default:
FALSE
. Whether or not to carry out removal of each feature, one at a time, which was chosen and then retrain and model and predict the test set, to measure the change in performance metric. Can also be set to TRUE, if required. Modelling run time will be noticeably longer.
Examples
#if(require(sparsediscrim))
#{
ModellingParams() # Default is differences in means selection and DLDA.
#> An object of class "ModellingParams"
#> Slot "balancing":
#> [1] "downsample"
#>
#> Slot "transformParams":
#> NULL
#>
#> Slot "selectParams":
#> An object of class 'SelectParams'.
#> Selection Name: Difference in Means.
#>
#> Slot "trainParams":
#> An object of class 'TrainParams'.
#> Classifier Name: Diagonal LDA.
#>
#> Slot "predictParams":
#> An object of class 'PredictParams'.
#>
#> Slot "doImportance":
#> [1] FALSE
#>
ModellingParams(selectParams = NULL, # No feature selection before training.
trainParams = TrainParams("randomForest"),
predictParams = PredictParams("randomForest"))
#> An object of class "ModellingParams"
#> Slot "balancing":
#> [1] "downsample"
#>
#> Slot "transformParams":
#> NULL
#>
#> Slot "selectParams":
#> NULL
#>
#> Slot "trainParams":
#> An object of class 'TrainParams'.
#> Classifier Name: Random Forest.
#>
#> Slot "predictParams":
#> An object of class 'PredictParams'.
#>
#> Slot "doImportance":
#> [1] FALSE
#>
#}