Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Created April 27, 2020 05:54
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 lakshay-arora/74c5ff3176c77e873df0fcc69dc47605 to your computer and use it in GitHub Desktop.
Save lakshay-arora/74c5ff3176c77e873df0fcc69dc47605 to your computer and use it in GitHub Desktop.
# create the object of LinearRegression Model
model_LR = LogisticRegression()
# fit the model with the training data
model_LR.fit(train_idf, train.label)
# predict the label on the traning data
predict_train = model_LR.predict(train_idf)
# predict the model on the test data
predict_test = model_LR.predict(test_idf)
# f1 score on train data
f1_score(y_true= train.label, y_pred= predict_train)
## >> 0.4888178913738019
f1_score(y_true= test.label, y_pred= predict_test)
## >> 0.45751633986928114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment