Spaces:
Runtime error
Runtime error
updated analysis
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ 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 |
|
@@ -44,25 +44,33 @@ analysis_class = data_analysis.Analysis()
|
|
44 |
|
45 |
option3 = st.selectbox(
|
46 |
'Select Exploratory Data Analysis type',
|
47 |
-
['None', 'DataPrep', 'SweetViz',]
|
48 |
)
|
49 |
|
50 |
if option3 == 'SweetViz':
|
51 |
res = analysis_class.sweetviz_analysis(df)
|
52 |
-
res.show_html(open_browser=True, layout='widescreen', scale=None)
|
|
|
|
|
|
|
|
|
53 |
|
54 |
elif option3 == 'DataPrep':
|
55 |
res = analysis_class.dataprep_analysis(df)
|
56 |
-
res.show_browser()
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
64 |
-
elif option3 == 'Pandas Profiling':
|
65 |
res = analysis_class.pandas_analysis(df)
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
|
68 |
model_names = [
|
|
|
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") # , layout="wide"
|
14 |
|
15 |
col1,col2 = st.columns([1,2])
|
16 |
|
|
|
44 |
|
45 |
option3 = st.selectbox(
|
46 |
'Select Exploratory Data Analysis type',
|
47 |
+
['None', 'DataPrep', 'SweetViz', 'PandasProfiling']
|
48 |
)
|
49 |
|
50 |
if option3 == 'SweetViz':
|
51 |
res = analysis_class.sweetviz_analysis(df)
|
52 |
+
res.show_html(filepath='SweetViz.html', open_browser=True, layout='widescreen', scale=None)
|
53 |
+
HtmlFile = open('SweetViz.html', 'r', encoding='utf-8')
|
54 |
+
source_code = HtmlFile.read()
|
55 |
+
with st.expander("See Report"):
|
56 |
+
components.html(source_code, height=1000, scrolling=True)
|
57 |
|
58 |
elif option3 == 'DataPrep':
|
59 |
res = analysis_class.dataprep_analysis(df)
|
60 |
+
# res.show_browser()
|
61 |
+
res.save('DataPrep.html')
|
62 |
+
HtmlFile = open('DataPrep.html', 'r', encoding='utf-8')
|
63 |
+
source_code = HtmlFile.read()
|
64 |
+
with st.expander("See Report"):
|
65 |
+
components.html(source_code, height=1000, scrolling=True)
|
66 |
|
67 |
+
elif option3 == 'PandasProfiling':
|
|
|
68 |
res = analysis_class.pandas_analysis(df)
|
69 |
+
res.to_file("PandasProfiling.html")
|
70 |
+
HtmlFile = open('PandasProfiling.html', 'r', encoding='utf-8')
|
71 |
+
source_code = HtmlFile.read()
|
72 |
+
with st.expander("See Report"):
|
73 |
+
components.html(source_code, height=1000, scrolling=True)
|
74 |
|
75 |
|
76 |
model_names = [
|