import sys
from class_vis import prettyPicture
from prep_terrain_data import makeTerrainData

import matplotlib.pyplot as plt
import copy
import numpy as np
import pylab as pl


features_train, labels_train, features_test, labels_test = makeTerrainData()


########################## SVM #################################
### we handle the import statement and SVC creation for you here
from sklearn.svm import SVC
clf = SVC(kernel="linear")


#### now your job is to fit the classifier
#### using the training features/labels, and to
#### make a set of predictions on the test data

clf.fit(features_train,labels_train)
pred = clf.predict(features_test)

#### store your predictions in a list named pred

from sklearn.metrics import accuracy_score
acc = accuracy_score(pred, labels_test)

def submitAccuracy():
    return acc

[(11, 'prep_terrain_data.makeTerrainData', 'makeTerrainData', False, 'from prep_terrain_data import makeTerrainData\n'), (17, 'sklearn.svm.SVC', 'SVC', False, 'from sklearn.svm import SVC\n'), (30, 'sklearn.metrics.accuracy_score', 'accuracy_score', False, 'from sklearn.metrics import accuracy_score\n')]