Here is an example of the variables that I am working with
str(t.data)
'data.frame': 100 obs. of 99 variables:
$ MEMB_ID : Factor w/ 100 levels ...
$ ORDER_DT : Factor w/ 90 levels ...
$ SHIP_DT : Factor w/ 80 levels ...
$ COMPANY_NM : Factor w/ 98 levels ...
$ COMPANY_ADD : Factor w/ 90 levels ...
$ SHIP_VENDOR_CD : Factor w/ 10 levels "USPS" "FEDEX" "UPS" "DHL" ...
Here is the ksvm that I am trying to run.
m1 <- ksvm(SHIP_VENDOR_CD~.,data=t.data, kernel="rbfdot",C=5)
However, I am running into this error
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
I would greatly apperciate some help in debugging this error. I am not able to do a na.omit as according to this answer, but are there any other ways to get around this error?
Thanks,
B.Choi