<jupyter_start><jupyter_text>Training the Model<jupyter_code>df.head()
#separating the features

X =df.drop('test_result', axis = 1)
X.head()
y = df['test_result']
from sklearn.model_selection import train_test_split
df.shape
X_train, X_test, y_train, y_test = train_test_split(
                                    X, y, test_size=0.1, random_state=101)
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaled_X_train = scaler.fit_transform(X_train)
scaled_X_test = scaler.fit_transform(X_test)
from sklearn.linear_model import LogisticRegression
log_model = LogisticRegression()
log_model.fit(scaled_X_train, y_train)
log_model.coef_
y_pred = log_model.predict(scaled_X_test)
y_pred
y_pred[0]
df.head()
#y_pred = log_model.predict_proba(scaled_X_test)
#y_pred<jupyter_output><empty_output><jupyter_text>Classification Metrics<jupyter_code>from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
accuracy_score(y_test, y_pred)
confusion_matrix(y_test, y_pred)
from sklearn.metrics import plot_confusion_matrix
plot_confusion_matrix(log_model, scaled_X_test, y_test)
print(classification_report(y_test, y_pred))
from sklearn.metrics import precision_score, recall_score
precision_score(y_pred, y_test)
recall_score(y_pred, y_test)
from sklearn.metrics import plot_roc_curve, plot_precision_recall_curve
plot_roc_curve(log_model, scaled_X_test, y_test)
plot_precision_recall_curve(log_model, scaled_X_test, y_test)<jupyter_output>C:\Users\saura\anaconda3\envs\mltest1\lib\site-packages\sklearn\utils\deprecation.py:87: FutureWarning: Function plot_precision_recall_curve is deprecated; Function `plot_precision_recall_curve` is deprecated in 1.0 and will be removed in 1.2. Use one of the class methods: PrecisionRecallDisplay.from_predictions or PrecisionRecallDisplay.from_estimator.
  warnings.warn(msg, category=FutureWarning)
StarcoderdataJupyterStructuredCleanDedup