Spaces:
Runtime error
Runtime error
logo added
Browse files- Shorthills.png +0 -0
- app.py +16 -7
Shorthills.png
ADDED
app.py
CHANGED
@@ -8,11 +8,18 @@ from pybanking.EDA import data_analysis
|
|
8 |
import sklearn.metrics as metrics
|
9 |
from mlxtend.plotting import plot_confusion_matrix
|
10 |
import streamlit.components.v1 as components
|
11 |
-
import
|
12 |
|
13 |
-
st.set_page_config(page_title="Customer Churn Prediction Model")
|
14 |
|
15 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
df = model_churn.get_data()
|
18 |
|
@@ -47,6 +54,12 @@ if option3 == 'SweetViz':
|
|
47 |
elif option3 == 'DataPrep':
|
48 |
res = analysis_class.dataprep_analysis(df)
|
49 |
res.show_browser()
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
elif option3 == 'Pandas Profiling':
|
52 |
res = analysis_class.pandas_analysis(df)
|
@@ -76,10 +89,6 @@ X, y = model_churn.preprocess_inputs(df, option)
|
|
76 |
if option2 == 'Upload custom':
|
77 |
model = model_churn.train(df, model)
|
78 |
|
79 |
-
# st.subheader('This is the Preprocessed Data')
|
80 |
-
|
81 |
-
# st.dataframe(X.head(5))
|
82 |
-
|
83 |
y_pred = model.predict(X)
|
84 |
|
85 |
st.write("Accuracy:",metrics.accuracy_score(y, y_pred))
|
|
|
8 |
import sklearn.metrics as metrics
|
9 |
from mlxtend.plotting import plot_confusion_matrix
|
10 |
import streamlit.components.v1 as components
|
11 |
+
from PIL import Image
|
12 |
|
13 |
+
st.set_page_config(page_title="Customer Churn Prediction Model", layout="wide")
|
14 |
|
15 |
+
col1,col2 = st.columns([1,2])
|
16 |
+
|
17 |
+
with col1:
|
18 |
+
image = Image.open('Shorthills.png')
|
19 |
+
st.image(image)
|
20 |
+
|
21 |
+
with col2:
|
22 |
+
st.title('Customer Churn Prediction Model')
|
23 |
|
24 |
df = model_churn.get_data()
|
25 |
|
|
|
54 |
elif option3 == 'DataPrep':
|
55 |
res = analysis_class.dataprep_analysis(df)
|
56 |
res.show_browser()
|
57 |
+
# res.save('DataPrep.html')
|
58 |
+
# HtmlFile = open('DataPrep.html', 'r', encoding='utf-8')
|
59 |
+
# source_code = HtmlFile.read()
|
60 |
+
# with st.expander("See Report"):
|
61 |
+
# components.iframe(source_code, height=1000)
|
62 |
+
|
63 |
|
64 |
elif option3 == 'Pandas Profiling':
|
65 |
res = analysis_class.pandas_analysis(df)
|
|
|
89 |
if option2 == 'Upload custom':
|
90 |
model = model_churn.train(df, model)
|
91 |
|
|
|
|
|
|
|
|
|
92 |
y_pred = model.predict(X)
|
93 |
|
94 |
st.write("Accuracy:",metrics.accuracy_score(y, y_pred))
|