This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import random | |
| HANGMANPICS = [''' | |
| +---+ | |
| | | | |
| | | |
| | | |
| | | |
| | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HANGMANPICS = [''' | |
| +---+ | |
| | | | |
| | | |
| | | |
| | | |
| | | |
| =========''', ''' | |
| +---+ |