Skip to content
Snippets Groups Projects
Commit 5117f827 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 53d66759
No related branches found
No related tags found
No related merge requests found
......@@ -60,12 +60,12 @@ def logistic_regression(x, y):
yhat_prob = LR.predict_proba(x_test)
print(confusion_matrix(y_test, yhat, labels=[1,0]))
print('Accuracy: ', accuracy_score(y_test, yhat))
print('Jaccard Idx: ', jaccard_score(y_test, yhat))
print('Precision: ', precision_score(y_test, yhat))
print('Recall: ', recall_score(y_test, yhat))
print('F1: ', f1_score(y_test, yhat))
print('AUC: ', roc_auc_score(y_test, yhat_prob[:, 1]))
print('Accuracy: ', "{:.4f}".format(accuracy_score(y_test, yhat)))
print('Jaccard Idx: ', "{:.4f}".format(jaccard_score(y_test, yhat)))
print('Precision: ', "{:.4f}".format(precision_score(y_test, yhat)))
print('Recall: ', "{:.4f}".format(recall_score(y_test, yhat)))
print('F1: ', "{:.4f}".format(f1_score(y_test, yhat)))
print('AUC: ', "{:.4f}".format(roc_auc_score(y_test, yhat_prob[:, 1])))
def k_nearest_neighbors(x, y, k=4):
......@@ -82,10 +82,9 @@ def k_nearest_neighbors(x, y, k=4):
yhat = KN_C.predict(x_test)
yhat_prob = KN_C.predict_proba(x_test)
print(confusion_matrix(y_test, yhat, labels=[1,0]))
print('Accuracy: ', accuracy_score(y_test, yhat))
print('Jaccard Idx: ', jaccard_score(y_test, yhat))
print('Precision: ', precision_score(y_test, yhat))
print('Recall: ', recall_score(y_test, yhat))
print('F1: ', f1_score(y_test, yhat))
print('AUC: ', roc_auc_score(y_test, yhat_prob[:, 1]))
\ No newline at end of file
print('Accuracy: ', "{:.4f}".format(accuracy_score(y_test, yhat)))
print('Jaccard Idx: ', "{:.4f}".format(jaccard_score(y_test, yhat)))
print('Precision: ', "{:.4f}".format(precision_score(y_test, yhat)))
print('Recall: ', "{:.4f}".format(recall_score(y_test, yhat)))
print('F1: ', "{:.4f}".format(f1_score(y_test, yhat)))
print('AUC: ', "{:.4f}".format(roc_auc_score(y_test, yhat_prob[:, 1])))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment