search for: mushift

Displaying 1 result from an estimated 1 matches for "mushift".

Did you mean: _shift
2006 Jul 03
0
Questions concerning function 'svm' in e1071 package
...Johan Van Kerckhoven ORSTAT and University Center of Statistics Katholieke Universiteit Leuven ---------------------------------------------------------------------- #initialization of the problem rm(list=ls()) library(e1071) set.seed(2) n = 50 d = 4 p = 0.5 x = matrix(rnorm(n*d), ncol=d) mushift = c(1, -1, rep(0, d-2)) y = runif(n) > p y = factor(2*y - 1) x = x - outer(rep(1, n), mushift) x[y == 1, ] = x[y == 1] + 2*outer(rep(1, sum(y == 1)), mushift) svclass = svm(x, y, scale=FALSE, kernel="linear") #Computation of the weight vector w = t(svclass$coefs) %*% svclass$SV if...