I am using the kernlab package for svm in R.I am using the linear kernel so that I can directly check the importance of the feature vectors, that is my variables.Using the coefficients of these feature vectors,I am required to calculate the weight of the various factors in the model,so that the linear separating plane that the svm will draw in my feature space can we evaluated. Basically I want to calculate the w in transpose(w)*x + b. Could someone please suggest what is to be done. I used the fields alpha and b and apha index and tried to logically calculate the weight vector, but to verify if I was calculating correctly I tried to predict on a test sample its correct predicted score, and this did not match the value predicted by the inbuilt predict function. How to calculate the weights?
Asked
Active
Viewed 942 times
0
-
Welcome to Stackoverflow! It would help to have a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) if you wish to get an answer faster. – akhmed Jun 03 '15 at 23:37
-
found the answer. ksvm actually returns -b and not b, so thats why my results were wrong. – Ankit Samantara Jun 04 '15 at 04:40