I am using stepAIC() function from library (MASS).
And per the documentation it says that I can pass an 'object':
a model of an appropriate class. This is used as the initial model in the stepwise search.
What is an appropriate class?
I created a model using ksvm() but, stepAIC seems not to accept it.
I am using the code:
stepAIC(svmFit, direction="both")
And I get the error
Error: $ operator not defined for this S4 class
The object svmFit I am passing is of class:
[1] "ksvm"
attr(,"package")
[1] "kernlab"