Skip to content

Instantly share code, notes, and snippets.

@mikaelbr
Created March 14, 2013 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikaelbr/5160021 to your computer and use it in GitHub Desktop.
Save mikaelbr/5160021 to your computer and use it in GitHub Desktop.
######################################################################
# Showing for <models.svm.SVM object at 0x1052c9f90>
Best params: {'steps': [('vect', TfidfVectorizer(analyzer='word', binary=False, charset='utf-8',
charset_error='ignore', dtype=<type 'long'>, input='content',
lowercase=True, max_df=1.0, max_features=None, max_n=None,
min_df=2, min_n=None, ngram_range=(1, 1), norm='l2',
preprocessor=<function remove_noise at 0x104787410>,
smooth_idf=True, stop_words=None, strip_accents=None,
sublinear_tf=True, token_pattern=u'(?u)\\b\\w\\w+\\b',
tokenizer=<function tokenize at 0x104787848>, use_idf=False,
vocabulary=None)), ('clf', LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,
intercept_scaling=1, loss='l2', multi_class='ovr', penalty='l2',
random_state=None, tol=0.0001, verbose=0))]}
Top Features for Model: <models.svm.SVM object at 0x1052c9f90>
dimensionality: 7540
density: 0.987709991158
top 15 keywords per class:
negative: injury, lost, not, :-(, shit, bad, stupid, cancelled, worse, worst,
sad, hate, sorry, fuck, :(
neutral: trayvon, tallahassee, rush, load, clemson, calling, set, nba, theres,
yea, jump, vote, 8th, question, paterno
positive: thanks, glad, :), nice, awesome, cool, interesting, amazing, best,
love, good, fun, happy, excited, great
==============================
# Total Score: 0.655985489722
==============================
precision recall f1-score support
negative 0.64 0.34 0.45 340
neutral 0.65 0.79 0.72 739
positive 0.66 0.67 0.67 575
avg / total 0.65 0.66 0.64 1654
[[116 148 76]
[ 36 585 118]
[ 29 162 384]]
######################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment