Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,16 @@ import streamlit as st
|
|
2 |
import pandas as pd
|
3 |
import numpy as np
|
4 |
import plotly.express as px
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score, learning_curve
|
6 |
from sklearn.linear_model import LinearRegression, LogisticRegression
|
7 |
from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier
|
@@ -11,7 +21,6 @@ from sklearn.feature_selection import SelectKBest
|
|
11 |
from sklearn.experimental import enable_iterative_imputer
|
12 |
from sklearn.impute import IterativeImputer
|
13 |
from sklearn.neural_network import MLPRegressor
|
14 |
-
import joblib
|
15 |
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error, accuracy_score, precision_score, recall_score, f1_score
|
16 |
from sklearn.impute import KNNImputer, SimpleImputer
|
17 |
from sklearn.preprocessing import RobustScaler, StandardScaler, OneHotEncoder, LabelEncoder
|
@@ -19,13 +28,7 @@ from sklearn.compose import ColumnTransformer
|
|
19 |
from sklearn.pipeline import Pipeline
|
20 |
from ydata_profiling import ProfileReport
|
21 |
from streamlit_pandas_profiling import st_profile_report
|
22 |
-
|
23 |
-
import requests
|
24 |
-
import asyncio
|
25 |
-
from io import BytesIO
|
26 |
-
import base64
|
27 |
-
import mimetypes
|
28 |
-
import matplotlib.pyplot as plt
|
29 |
|
30 |
# Enhanced configuration
|
31 |
st.set_page_config(
|
@@ -602,10 +605,13 @@ elif app_mode == "Advanced EDA":
|
|
602 |
config = st.session_state.eda_config
|
603 |
|
604 |
if config['plot_type'] == "Histogram":
|
|
|
|
|
605 |
fig = px.histogram(
|
606 |
df, x=config['x_col'], y=config['y_col'],
|
607 |
nbins=30, template="plotly_dark",
|
608 |
-
|
|
|
609 |
)
|
610 |
|
611 |
elif config['plot_type'] == "Scatter Plot":
|
@@ -730,7 +736,7 @@ elif app_mode == "Advanced EDA":
|
|
730 |
with st.spinner("Generating report..."):
|
731 |
pr = ProfileReport(df, explorative=True)
|
732 |
st_profile_report(pr)
|
733 |
-
|
734 |
# Model Training Section
|
735 |
elif app_mode == "Model Training":
|
736 |
st.title("🚂 Model Training Studio")
|
|
|
2 |
import pandas as pd
|
3 |
import numpy as np
|
4 |
import plotly.express as px
|
5 |
+
from scipy import stats
|
6 |
+
import plotly.colors as pc
|
7 |
+
import joblib
|
8 |
+
from io import StringIO
|
9 |
+
import requests
|
10 |
+
import asyncio
|
11 |
+
from io import BytesIO
|
12 |
+
import base64
|
13 |
+
import mimetypes
|
14 |
+
import matplotlib.pyplot as plt
|
15 |
from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score, learning_curve
|
16 |
from sklearn.linear_model import LinearRegression, LogisticRegression
|
17 |
from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier
|
|
|
21 |
from sklearn.experimental import enable_iterative_imputer
|
22 |
from sklearn.impute import IterativeImputer
|
23 |
from sklearn.neural_network import MLPRegressor
|
|
|
24 |
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error, accuracy_score, precision_score, recall_score, f1_score
|
25 |
from sklearn.impute import KNNImputer, SimpleImputer
|
26 |
from sklearn.preprocessing import RobustScaler, StandardScaler, OneHotEncoder, LabelEncoder
|
|
|
28 |
from sklearn.pipeline import Pipeline
|
29 |
from ydata_profiling import ProfileReport
|
30 |
from streamlit_pandas_profiling import st_profile_report
|
31 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Enhanced configuration
|
34 |
st.set_page_config(
|
|
|
605 |
config = st.session_state.eda_config
|
606 |
|
607 |
if config['plot_type'] == "Histogram":
|
608 |
+
color_palette = config['color_palette']
|
609 |
+
colors = getattr(pc.sequential, color_palette)
|
610 |
fig = px.histogram(
|
611 |
df, x=config['x_col'], y=config['y_col'],
|
612 |
nbins=30, template="plotly_dark",
|
613 |
+
color=config['x_col'],
|
614 |
+
color_discrete_sequence = [colors[0]]
|
615 |
)
|
616 |
|
617 |
elif config['plot_type'] == "Scatter Plot":
|
|
|
736 |
with st.spinner("Generating report..."):
|
737 |
pr = ProfileReport(df, explorative=True)
|
738 |
st_profile_report(pr)
|
739 |
+
|
740 |
# Model Training Section
|
741 |
elif app_mode == "Model Training":
|
742 |
st.title("🚂 Model Training Studio")
|