Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何从$best.model in tune.svm(e1071)中获得交叉验证精度?_R_Svm - Fatal编程技术网

R 如何从$best.model in tune.svm(e1071)中获得交叉验证精度?

R 如何从$best.model in tune.svm(e1071)中获得交叉验证精度?,r,svm,R,Svm,我能够从svm获得模型的cv精度,无需调整,如下所示 model=svm(formula,data,kernel=kernel,gamma=gamma,degree=degree,coef0=coef0,cost=cost,cross=10) model$tot.accuracy 但是,当我使用tune.svm时,我无法从svm获得模型的cv精度 data(iris) obj <- tune.svm(Species~., data = iris, cost = 1:2, gamma =

我能够从svm获得模型的cv精度,无需调整,如下所示

model=svm(formula,data,kernel=kernel,gamma=gamma,degree=degree,coef0=coef0,cost=cost,cross=10)
model$tot.accuracy
但是,当我使用tune.svm时,我无法从svm获得模型的cv精度

data(iris)
obj <- tune.svm(Species~., data = iris, cost = 1:2, gamma = 1:2, kernel = "radial") 
obj$best.model
数据(iris)

obj准确度可通过以下方法获得:

obj$best.performance

该值表示所有调谐组合的最小误差,对吗?你能详细说明一下这个值吗?先谢谢,好的。对于分类,性能度量分类错误;对于回归,性能度量均方误差
obj$best。性能
通过在网格搜索中使用超参数的最佳组合,即成本从1到2,伽马从1到2,为您提供了最小的错误。您还可以使用
obj$performances
查看所有性能度量。希望我的回答有帮助。