bhnascar / Viral-Art

CS231A final project
0 stars 0 forks source link

Figure out SVN artist prediction issue #52

Open bhnascar opened 8 years ago

bhnascar commented 8 years ago

Consistently predicts 0 for everything, i.e nothing is made by the artist we're testing against. Might be some kind of setup/parameter tuning issue.

Linear regression works...kinda, but SVN is supposed to be a lot better.

mindyh commented 8 years ago

You need to use Grid Search.

raw_svm = svm.SVC(decision_function_shape='ovr', class_weight='balanced', probability=True) search_params = {'kernel':['rbf'], 'C':[1, 10, 100, 1000], 'gamma': [0.00001, 0.0001, 0.01, 1, 10, 100]} svm_cv = grid_search.GridSearchCV(raw_svm, param_grid=search_params, scoring='recall', cv=5, n_jobs=-1, verbose=5) svm_cv.fit(test_train_sets['X_train'], test_train_sets['y_train']) print(svm_cv.best_params_)

bhnascar commented 8 years ago

LOL thanks for finding that and pasting it here.