Skip to content

Commit

Permalink
Create svm_sklearn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalkarn committed May 16, 2016
1 parent 384c236 commit f2a2593
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions svm_sklearn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import numpy as np
from sklearn import svm

# Read the data
train = np.loadtxt(open("train.csv","rb"), delimiter=",", skiprows=0)
trainLabels = np.loadtxt(open("trainLabels.csv","rb"), delimiter=",", skiprows=0)
test = np.loadtxt(open("test.csv","rb"), delimiter=",", skiprows=0)


X, y = train, trainLabels
s = svm.SVC()
s.fit(X, y)

predictions = s.predict(test)
np.savetxt("fancySVMSubmission.csv", predictions.astype(int), fmt='%d', delimiter=",")

0 comments on commit f2a2593

Please sign in to comment.