Skip to content

Instantly share code, notes, and snippets.

@keitazoumana
Created November 28, 2021 15:17
Show Gist options
  • Save keitazoumana/bd3b6e2be0336690f37cb991c90d040f to your computer and use it in GitHub Desktop.
Save keitazoumana/bd3b6e2be0336690f37cb991c90d040f to your computer and use it in GitHub Desktop.
"""
Content of train_model.py
"""
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
import pickle
def run_model_training(X_train, X_test, y_train, y_test):
clf = LogisticRegression()
clf.fit(X_train,y_train)
clf.score(X_test,y_test)
y_pred = clf.predict(X_test)
print("\n3. Model Performance: \n")
print(classification_report(y_test, y_pred))
return clf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment