Skip to content

Instantly share code, notes, and snippets.

@chrishorton
Created May 29, 2017 23:44
Show Gist options
  • Save chrishorton/7ca493693f3fdad61d490f48ef939049 to your computer and use it in GitHub Desktop.
Save chrishorton/7ca493693f3fdad61d490f48ef939049 to your computer and use it in GitHub Desktop.
def train(dataSet, target):
clf = svm.SVC(gamma=0.00000001, probability=True, C=1000000, verbose=True, tol=1e-10, cache_size=600, kernel='rbf',
class_weight='balanced')
n_samples = len(dataSet)
a = np.array(dataSet)
b = np.array(target)
print b
x_train, x_test, y_train, y_test = model_selection.train_test_split(a, b, test_size=0.20)
clf.fit(x_train[:n_samples], y_train[:n_samples])
joblib.dump(clf, 'trained_alpha_clf.pkl')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment