From 252450c610c693805e88978afd8395424d88c710 Mon Sep 17 00:00:00 2001 From: Douglas Date: Fri, 13 Feb 2015 12:09:06 +0800 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 49cf5f5..21568b8 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,16 @@ Python modules for analyzing LJ40K emotion data ```python >> from feelit.features import Learning >> learner = Learning(verbose=args.verbose, debug=args.debug) - >> learner.set(X_train, y_train, feature_name) - >> - >> scores = {} - >> for C in Cs: - >> for gamma in gammas: - >> score = learner.kFold(kfolder, classifier='SVM', - >> kernel='rbf', prob=False, - >> C=c, scaling=True, gamma=gamma) - >> scores.update({(c, gamma): score}) - >> + >> learner.set(X_train, y_train, feature_name) + >> + >> scores = {} + >> for C in Cs: + >> for gamma in gammas: + >> score = learner.kFold(kfolder, classifier='SVM', + >> kernel='rbf', prob=False, + >> C=c, scaling=True, gamma=gamma) + >> scores.update({(c, gamma): score}) + >> >> best_C, best_gamma = max(scores.iteritems(), key=operator.itemgetter(1))[0] >> learner.train(classifier='SVM', kernel='rbf', prob=True, C=best_C, gamma=best_gamma, >> scaling=True, random_state=np.random.RandomState(0))