I used RSNNS to creat the model
x=data[sample(1:nrow(data),length(1:nrow(data))),]
xValues=x[,1:20]
xTarget=decodeClassLabels(x[,21])
x=splitForTrainingAndTest(xValues,xTarget,ratio = 0.3)
x=normTrainingAndTestSet(x)
model=mlp(x$inputsTrain, x$targetsTrain, size=20,
learnFuncParams = c(0.001), maxit=1000,
inputsTest =x$inputsTest,
targetsTest = x$targetsTest)
then, I used confusion matrix to find out the accuracy of training and test set.
predictions <- predict(model,x$targetsTest)
confusionMatrix(x$targetsTest,predictions)
and the error came out:
Error in myFunc[[1]](x, ...) :
number of input data columns 4 does not match number of input neurons 20
I don't know what is the error meaning and how to solve the problem. Please, help me, thank you a lot!!
the part of target data enter image description here the part of value data enter image description here