Created
December 23, 2019 02:04
-
-
Save ashokc/0cb345673878277e6ffa83894485b2ba to your computer and use it in GitHub Desktop.
This file contains 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 runModel (train_docs, train_labels, test_docs, test_labels, vectorizer): | |
model = LogisticRegression(tol=1.0e-6,random_state=0,max_iter=20000, class_weight='balanced') | |
train_X = vectorizer.transform(train_docs) | |
test_X = vectorizer.transform(test_docs) | |
model.fit(train_X, train_labels) | |
predicted_labels = model.predict (test_X) | |
scores = model.predict_proba(test_X) | |
return findMetrics (scores, predicted_labels, test_labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment