Skip to content

Instantly share code, notes, and snippets.

@ergo70
Last active January 27, 2016 05:55
Show Gist options
  • Save ergo70/4aa07956b72a78df4f0f to your computer and use it in GitHub Desktop.
Save ergo70/4aa07956b72a78df4f0f to your computer and use it in GitHub Desktop.
R SVM demo code
library(e1071)
data <- seq(1,10)
classes <- c('b','b','b','b','a','a','a','a','b','b')
mysvm = svm (data, classes, type='C', kernel='radial', gamma=0.1, cost=10)
pred = predict (mysvm, data)
print(table(pred, classes))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment