2

I've got a list of trainingsets (each with 944 instances) and a list of testsets (each with 188 instances). I want to make a model from my first trainingset and test it on my first testset. I've got the following code:

traindata <- data.frame(data[trainingset[[1]], 120:130],data2[trainingset[[1]],ncol(data2)])
testdata <- data.frame(data2[testset[[1]], 120:130])
RPART_model <- rpart(data2[trainingsets[[1]],ncol(data2)]~., data=traindata)
RPART_testpredictions <- predict(RPART_model, new=testdata, type ="vector")

But when I control my RPART_testpredictions with length(RPART_testpredictions), I become 944.

Can someone help me?

Silke
  • 177
  • 1
  • 11
  • 1
    Spelling? `trainingset` != `trainingsets`. If that's not it, then you need to show the code that created `traininset` and `testset`. – IRTFM Dec 04 '13 at 10:13

0 Answers0