PredictParams {ClassifyR} | R Documentation

## Parameters for Classifier Prediction

### Description

Collects the function to be used for making predictions and any associated parameters.

The function specified must return either a factor vector of class predictions, or a numeric vector of scores for the second class, according to the levels of the class vector of the input data set, or a data frame which has two columns named class and score.

### Constructor

  `PredictParams()` Creates a default PredictParams object. This assumes that the object returned by the classifier has a list element named "class".

  `PredictParams(predictor, intermediate = character(0), ...)` Creates a PredictParams object which stores the function which will do the class prediction, if required, and parameters that the function will use. If the training function also makes predictions, this must be set to `NULL`.

  `predictor`

    Either `NULL` or a function to make predictions with. If it is a function, then the first argument must accept the classifier made in the training step. The second argument must accept a `DataFrame` of new data.

  `intermediate`

    Character vector. Names of any variables created in prior stages in `runTest` that need to be passed to the prediction function.

  `...`

    Other arguments that `predictor` may use.

### Author(s)

Dario Strbenac

### Examples

    predictParams <- PredictParams(predictor = DLDApredictInterface)
    # For prediction by trained object created by DLDA training function.
    PredictParams(predictor = NULL)
    # For when the training function also does prediction and directly returns the
    # predictions.

[Package ClassifyR version 2.4.4 Index]