tuneParetoClassifier {TunePareto} | R Documentation |
Create a classifier object
Description
Creates a wrapper object mapping all information necessary to call a classifier which can be passed to tunePareto
.
Usage
tuneParetoClassifier(name,
classifier,
classifierParamNames = NULL,
predefinedClassifierParams = NULL,
predictor = NULL,
predictorParamNames = NULL,
predefinedPredictorParams = NULL,
useFormula = FALSE,
formulaName = "formula",
trainDataName = "x",
trainLabelName = "y",
testDataName = "newdata",
modelName = "object",
requiredPackages = NULL)
Arguments
name |
A human-readable name of the classifier |
classifier |
The classification function to use. If |
classifierParamNames |
A vector of names of possible arguments for |
predefinedClassifierParams |
A named list of default values for the classifier parameters. |
predictor |
If the classification method consists of separate training and prediction functions, this points to the prediction function that receives a model and the test data as inputs and returns the predicted class labels. |
predictorParamNames |
If |
predefinedPredictorParams |
If |
useFormula |
Set this to true if the classifier expects a formula to describe the relation between features and class labels. The formula itself is built automatically. |
formulaName |
If |
trainDataName |
The name of the paramater of the classifier's training function that holds the training data. |
trainLabelName |
If |
testDataName |
If |
modelName |
If |
requiredPackages |
A vector containing the names of packages that are required to run the classifier. These packages are loaded automatically when running the classifier using |
Details
TunePareto classifier objects are wrappers containing all information necessary to run the classifier, including the training and prediction function, the required packages, and the names of certain arguments. TunePareto provides a set of predefined objects for state-of-the-art classifiers (see predefinedClassifiers
).
The main tunePareto
routine evaluates TuneParetoClassifier
objects to call the training and prediction methods. Furthermore, direct calls to the classifiers are possible using trainTuneParetoClassifier
and predict.TuneParetoModel
.
Value
An object of class TuneParetoClassifier
with components corresponding to the above parameters.
See Also
trainTuneParetoClassifier
, predict.TuneParetoModel
, tunePareto
, predefinedClassifiers
Examples
# equivalent to tunePareto.svm()
cl <- tuneParetoClassifier(name = "svm",
classifier = svm,
predictor = predict,
classifierParamNames = c("kernel", "degree", "gamma",
"coef0", "cost", "nu",
"class.weights", "cachesize",
"tolerance", "epsilon",
"subset", "na.action"),
useFormula = FALSE,
trainDataName = "x",
trainLabelName = "y",
testDataName = "newdata",
modelName = "object",
requiredPackages="e1071")
# call TunePareto with the classifier
print(tunePareto(classifier = cl,
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
cost = c(0.001,0.01,0.1,1,10),
objectiveFunctions=
list(cvError(10, 10),
cvSpecificity(10, 10,
caseClass="setosa"))))