Skip to content

Instantly share code, notes, and snippets.

View chrishorton's full-sized avatar

Chris Horton chrishorton

View GitHub Profile
@chrishorton
chrishorton / hangmanwordbank.py
Created May 21, 2017 17:16
Hangman ascii art and wordbank
HANGMANPICS = ['''
+---+
| |
|
|
|
|
=========''', '''
+---+
from __future__ import print_function
import random
HANGMANPICS = ['''
+---+
| |
|
|
|
|
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')