Skip to content

Instantly share code, notes, and snippets.

@nlauchande
Last active September 1, 2019 13:47
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 nlauchande/f381ea207cd78f4e7ee95b6cef544ce5 to your computer and use it in GitHub Desktop.
Save nlauchande/f381ea207cd78f4e7ee95b6cef544ce5 to your computer and use it in GitHub Desktop.
train, test = train_test_split(final_dataset, random_state=42, test_size=0.33, shuffle=True)
X_train = train.text
X_test = test.text
LogReg_pipeline = Pipeline([
('tfidf', TfidfVectorizer(sublinear_tf=True, min_df=5, norm='l2', encoding='latin-1', ngram_range=(1, 2), stop_words='english')),
('clf',LogisticRegression(solver='sag'),),
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment