tuneParetoClassifier | R Documentation |
Creates a wrapper object mapping all information necessary to call a classifier which can be passed to tunePareto
.
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)
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 |
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
.
An object of class TuneParetoClassifier
with components corresponding to the above parameters.
trainTuneParetoClassifier
, predict.TuneParetoModel
, tunePareto
, predefinedClassifiers
# 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"))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.