1

I'm using gausspr function from the kernlab package for Gaussian process classification, and running into the following error message:

Error in votematrix[i, ret > 0] : (subscript) logical subscript too long

anytime I try to use the classifier to make predictions on a dataset that has more observations than the training set. Here's a very simple example to reproduce this problem:

data(iris)
gp1 = gausspr(Species ~., data=iris)
predict(gp1,iris[c(1:150,1),-5])

Has anyone else run into this problem? Any insights into how to get around it other than calling predict many times on smaller subsets of the test data?

Thanks!

Ana
  • 83
  • 1
  • 1
  • 4

1 Answers1

1

I don't have time to review the code right now, but predicting 'probabilities' jumps the faulty code, so try this instead:

data(iris)
gp1 = gausspr(Species ~., data=iris)
predict(gp1,iris[c(1:150,1),-5], type = 'probabilities')

And work with the probabilities.


This is the loop that outputs that error if you want to review it.

catastrophic-failure
  • 3,759
  • 1
  • 24
  • 43