Spaces:
Runtime error
Runtime error
Create definitions.py
Browse files- definitions.py +25 -0
definitions.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import streamlit as st
|
3 |
+
import numpy as np
|
4 |
+
from sklearn.model_selection import train_test_split
|
5 |
+
from sklearn.datasets import load_breast_cancer
|
6 |
+
from sklearn.metrics import roc_auc_score,roc_curve,auc,accuracy_score,classification_report,confusion_matrix,precision_recall_curve
|
7 |
+
import lightgbm as lgb
|
8 |
+
import matplotlib.pyplot as plt
|
9 |
+
import warnings
|
10 |
+
warnings.filterwarnings('ignore')
|
11 |
+
|
12 |
+
def plot_roc(fpr, tpr, label=None):
|
13 |
+
roc_auc = auc(fpr, tpr)
|
14 |
+
plt.title('Receiver Operating Characteristic')
|
15 |
+
plt.plot(fpr, tpr, 'b', label = 'AUC = %0.2f' % roc_auc)
|
16 |
+
plt.legend(loc = 'lower right')
|
17 |
+
plt.plot([0, 1], [0, 1],'r--')
|
18 |
+
plt.xlim([0, 1])
|
19 |
+
plt.ylim([0, 1])
|
20 |
+
plt.ylabel('True Positive Rate')
|
21 |
+
plt.xlabel('False Positive Rate')
|
22 |
+
plt.show()
|
23 |
+
st.pyplot()
|
24 |
+
© 2022 GitHub, Inc.
|
25 |
+
Terms
|