TrainParams-class: Parameters for Classifier Training

Description Constructor Author(s) Examples

Description

Collects and checks necessary parameters required for classifier training. The empty constructor is provided for convenience.

Constructor

TrainParams() Creates a default TrainParams object. The classifier function is DLDA. Users should create an appropriate TrainParams object for the characteristics of their data, once they are familiar with this software.

TrainParams(classifier, intermediate = character(0), getFeatures = NULL, ...) Creates a TrainParams object which stores the function which will do the classifier building and parameters that the function will use.

classifier

A function which will construct a classifier, and also possibly make the predictions. The first argument must be a DataFrame object. The second argument must be a vector of classes. If the function also makes predictions and the value of the predictor setting of PredictParams is therefore NULL, the third argument must be a DataFrame of test data. The function must also accept a parameter named verbose. The function's return value can be either a trained classifier if the function only does training or a vector or data frame of class predictions if it also does prediction with the test set samples.

intermediate

Character vector. Names of any variables created in prior stages by runTest that need to be passed to classifier.

getFeatures

A function may be specified that extracts the selected features from the trained model. This is relevant if using a classifier that does feature selection within training (e.g. random forest). The function must return a list of two vectors. The first vector contains the ranked features (or empty if the training algorithm doesn't produce rankings) and the second vector contains the selected features.

...

Other named parameters which will be used by the classifier.

Author(s)

Dario Strbenac

Examples

1
2
if(require(sparsediscrim))
  trainParams <- TrainParams(DLDAtrainInterface)

ClassifyR documentation built on May 19, 2018, 6:01 p.m.