Vignesh Prajapati
2012-Oct-17 10:10 UTC
[R] Svm modeling :: Error in which.max(votematrix[, x]) : subscript out of bounds
Having a classification problem, I am using SVM for prediction in R. In
dataset, there are integer as well as categorical variables. I got error
while predicting with predict method.
svp3c <- ksvm(input_dataset3$isCRgt3~.,
data=input_dataset3,type="C-svc")
p3<-predict(svp3c,newdata=input_dataset_prediction[,-1],type="response")
error :: Error in which.max(votematrix[, x]) : subscript out of bounds
For this modeling
First : developed model with training dataset
second : saved and Load model for prediction on testing dataset
Here is my script sample ::
-----------------------------------------------------sample
Script------------------------------------------------------------------
input_dataset_prediction <-
data.frame(isCRgt3,visitcount,word=factor("hi",levels=as.character(l1_word)),medium=factor("organic",levels=as.character(l1_q_medium)),q_landingPagePath=factor("/",levels=as.character(l1_q_landingPagePath)),q_exitPagePath=factor("/mail/InboxLight.aspx",levels=as.character(l1_q_exitPagePath)),q_referralPath=factor("(not
set)",levels=as.character(l1_q_referralPath)),visits=visits,transactions=transactions,transaction_revenue=transaction_revenue,revenuepertransaction=revenuepertransaction)
load("D:/TATVIC-ML/SVM/CR &
AOV-SVM/Final/Datasets/Train/Model3_YDW_CR.rda")
p3<-predict(svp3c,newdata=input_dataset_prediction[,-1],type="response")
s3<-data.frame(input_dataset_prediction$isCRgt3,p3)
Can any one give suggestion?
[[alternative HTML version deleted]]
