Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating simple rules of classification based on linear SVM coeficients
    text
    copied!<p>Gretings. I'm trying to translate SVM findings in a linear combination of predictors. </p> <p>Here is an example of R code :</p> <pre><code>## Data example test = structure(list(y_bin = c(1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0), X1 = c(0L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 0L, 0L), X2 = c(0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L), X3 = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L), X4 = c(0L, 0L, 0L, 0L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, -1L, 0L, -1L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, -1L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, 0L, -1L, 0L, -1L, -1L, 0L, 0L, -1L, -1L, 0L, 0L, 0L, -1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("y_bin", "X1", "X2", "X3", "X4"), row.names = c(NA, 50L), class = "data.frame") y_bin = test[,1] w_bin = test[,-1] #SVM estimation fit = svm(y_bin ~ ., data=test, type='C-classification', kernel='linear') #Computing Prediction pred = predict(fit, test) # Computing weigt weight = t(fit$coefs) %*% fit$SV # Calculate decision values manually fit$decision.values </code></pre> <p>My question is : based on estimated weight and intercept (rho), is it possible to define a linear combination of weight with a threshold for classiying entries and having same result as SVM.</p> <p>Prescilely : let Wa, Wb, Wc three estimated weight by SVM and a threshold t.</p> <p>I want to find some way to define a decision rules such as :</p> <p>For example, considering one entries : if rho + Wa*X1 + Wa*X2 + Wa*X3 > t then status 1, o otherwise</p> <p>May you have some references or code example ?</p> <p>Warmly thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload