predefinedClassifiers(TunePareto)
predefinedClassifiers()所属R语言包:TunePareto
TunePareto wrappers for certain classifiers
对于某些分类的TunePareto包装
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Creates TunePareto classifier objects for the k-Nearest Neighbour classifier, support vector machines, and trees.
创建TunePareto分类对象的k-最近邻分类器,支持向量机,和树木。
用法----------Usage----------
tunePareto.knn()
tunePareto.svm()
tunePareto.tree()
tunePareto.randomForest()
tunePareto.NaiveBayes()
Details
详细信息----------Details----------
tunePareto.knn encapsulates a k-Nearest Neighbour classifier as defined in link[class]{knn} in package class. The classifier allows for supplying and tuning the following parameters of link[class]{knn}:
tunePareto.knn封装的K-近邻分类中定义的link[class]{knn}的包class。分类器可以提供和调整下列参数link[class]{knn}的:
k, l, use.all
k, l, use.all
tunePareto.svm encapsulates the support vector machine svm classifier in package e1071. The classifier allows for supplying and tuning the following parameters:
tunePareto.svm封装的支持向量机svm分类在包e1071。该分类器允许用于供给和调整以下参数:
kernel, degree, gamma, coef0, cost, nu, class.weights, cachesize, tolerance, epsilon, scale, shrinking, fitted, subset, na.action
kernel, degree, gamma, coef0, cost, nu, class.weights, cachesize, tolerance, epsilon, scale, shrinking, fitted, subset, na.action
tunePareto.tree encapsulates the CART classifier tree in package tree. The classifier allows for supplying and tuning the following parameters:
tunePareto.tree封装的CART分类tree的包tree。该分类器允许用于供给和调整以下参数:
weights, subset, na.action, method, split, mincut, minsize, mindev
weights, subset, na.action, method, split, mincut, minsize, mindev
as well as the type parameter of predict.tree.
以及type参数predict.tree。
tunePareto.randomForest encapsulates the randomForest classifier in package randomForest. The classifier allows for supplying and tuning the following parameters:
tunePareto.randomForest封装randomForest分类在包randomForest。该分类器允许用于供给和调整以下参数:
subset, na.action, ntree, mtry, replace, classwt, cutoff, strata, sampsize, nodesize, maxnodes
subset, na.action, ntree, mtry, replace, classwt, cutoff, strata, sampsize, nodesize, maxnodes
tunePareto.NaiveBayes encapsulates the NaiveBayes classifier in package klaR. The classifier allows for supplying and tuning the following parameters:
tunePareto.NaiveBayes封装NaiveBayes分类在包klaR。该分类器允许用于供给和调整以下参数:
prior, usekernel, fL, subset, na.action, bw, adjust, kernel, weights, window, width, give.Rkern, n, from, to, cut, na.rm
prior, usekernel, fL, subset, na.action, bw, adjust, kernel, weights, window, width, give.Rkern, n, from, to, cut, na.rm
值----------Value----------
Returns objects of class TuneParetoClassifier as described in tuneParetoClassifier. These can be passed to functions like tunePareto or trainTuneParetoClassifier.
返回类的对象TuneParetoClassifier所描述的tuneParetoClassifier。这些都可以通过的功能tunePareto或trainTuneParetoClassifier。
参见----------See Also----------
tuneParetoClassifier, tunePareto, trainTuneParetoClassifier
tuneParetoClassifier,tunePareto,trainTuneParetoClassifier
实例----------Examples----------
# tune a k-NN classifier with different 'k' and 'l' [调整的k-NN分类器与不同的K和l]
# on the 'iris' data set[IRIS数据集]
print(tunePareto(classifier = tunePareto.knn(),
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
k = c(5,7,9),
l = c(1,2,3),
objectiveFunctions=list(cvError(10, 10),
cvSpecificity(10, 10, caseClass="setosa"))))
# tune an SVM with different costs on [调整SVM不同的成本]
# the 'iris' data set[IRIS数据集]
# using Halton sequences for sampling[使用哈尔顿的采样序列]
print(tunePareto(classifier = tunePareto.svm(),
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
cost = as.interval(0.001,10),
sampleType = "halton",
numCombinations=20,
objectiveFunctions=list(cvWeightedError(10, 10),
cvSensitivity(10, 10, caseClass="setosa"))))
# tune a CART classifier with different [调整不同的CART分类]
# splitting criteria on the 'iris' data set[IRIS数据集的分割标准]
print(tunePareto(classifier = tunePareto.tree(),
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
split = c("deviance","gini"),
objectiveFunctions=list(cvError(10, 10),
cvErrorVariance(10, 10))))
# tune a Random Forest with different numbers of trees [用不同的数字调整随机森林树木]
# on the 'iris' data set[IRIS数据集]
print(tunePareto(classifier = tunePareto.randomForest(),
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
ntree = seq(50,300,50),
objectiveFunctions=list(cvError(10, 10),
cvSpecificity(10, 10, caseClass="setosa"))))
# tune a Naive Bayes classifier with different kernels[调整朴素贝叶斯分类器与不同的内核]
# on the 'iris' data set[IRIS数据集]
print(tunePareto(classifier = tunePareto.NaiveBayes(),
data = iris[, -ncol(iris)],
labels = iris[, ncol(iris)],
kernel = c("gaussian", "epanechnikov", "rectangular",
"triangular", "biweight",
"cosine", "optcosine"),
objectiveFunctions=list(cvError(10, 10),
cvSpecificity(10, 10, caseClass="setosa"))))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|