SVM模型中的错误:R中的预处理方法仅限于:BoxCox, YeoJohnson

我在尝试运行一个SVM模型时,遇到了以下错误:

错误:预处理方法仅限于:BoxCox, YeoJohnson, expoTrans, invHyperbolicSine, center, scale, range, knnImpute, bagImpute, medianImpute, pca, ica, spatialSign, ignore, keep, remove, zv, nzv, conditionalX, corr

我不明白哪里出了问题。

svm.model_unigrams = train(outcome ~.                           , data = training_set_unigrams                           , trControl = training_controls                           , method = "svmRadial"                           , preProcess = (training_set_unigrams, method = c("center", "scale"))                           , na.action = na.pass)

回答:

由于您没有提供任何数据,因此我使用了IRIS数据集。

library(caret)data(iris)svm.model_unigrams = train(Species ~., data = iris,                            trControl = trainControl(method = "cv",                                                      number = 5,                                                      allowParallel = TRUE),                            method = "svmRadial",                            preProc = c("center", "scale"),                            na.action = na.pass)

同样,您可以使用其他方法,例如

train(Species ~., data = iris,                           trControl = trainControl(method = "cv",                                                    number = 5,                                                    allowParallel = TRUE),                           method = "svmRadial",                           preProc = c("BoxCox"),                           na.action = na.pass)

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注