2

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

Jia You
  • 21
  • 1
  • 1
    Please don't post pictures of data. See [how to make a reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – MrFlick Jul 05 '17 at 15:49
  • Sorry, I try to edit my post but still don't know how to do. Could you tell me? thanks. – Jia You Jul 05 '17 at 16:27
  • The link I provided has many suggestions for improving the reproducibility of your question. – MrFlick Jul 05 '17 at 16:28

0 Answers0