我试图在数据集上训练多层感知器进行非线性回归,但它一直给我这个错误:
Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, :
There were missing values in resampled performance measures.
我尝试使用R数据集再次执行此操作以查看我的数据是否是问题,但我一直收到错误,我不明白为什么。
我已经尝试添加或删除tuneGrid,trControl,甚至linOut。 由于某些原因,它总是会给我不断的结果。
library(datasets)
library(MASS)
library(caret)
DP = caret::createDataPartition(Boston$medv, p=0.75, list = F)
train = Boston[DP,]
test = Boston[-DP,]
colnames(train) = colnames(Boston)
colnames(test) = colnames(Boston)
mlp = caret::train(medv ~., data = Boston, method = "mlp", trControl = trainControl(method = "cv", number = 3),
tuneGrid = expand.grid(size = 1:3), linOut = T, metric = "RMSE")
Yp = caret::predict.train(mlp, test[,1:13])