Spaces:
Sleeping
Sleeping
Needs to add hyperparameter+ itegrate with streamlit
Browse files- __pycache__/regression.cpython-310.pyc +0 -0
- app.py +52 -10
- regression.py +0 -1
__pycache__/regression.cpython-310.pyc
ADDED
Binary file (3.11 kB). View file
|
|
app.py
CHANGED
@@ -1,20 +1,17 @@
|
|
1 |
|
2 |
import pandas as pd
|
3 |
-
import matplotlib.pyplot as plt
|
4 |
-
from sklearn.decomposition import PCA
|
5 |
-
from sklearn.cluster import KMeans
|
6 |
-
from sklearn.preprocessing import StandardScaler
|
7 |
import warnings
|
8 |
import streamlit as st
|
9 |
-
|
10 |
-
from sklearn.linear_model import LogisticRegression
|
11 |
-
from sklearn.tree import DecisionTreeClassifier
|
12 |
from classification import ClassificationModels
|
|
|
|
|
13 |
warnings.filterwarnings("ignore")
|
14 |
import uuid
|
15 |
import time
|
16 |
|
17 |
|
|
|
18 |
# data cleaning: https://bank-performance.streamlit.app/
|
19 |
# https://docs.streamlit.io/library/api-reference/layout
|
20 |
|
@@ -25,10 +22,10 @@ import time
|
|
25 |
# st.write("Welcome to the Home Page")
|
26 |
|
27 |
def regressor():
|
28 |
-
train, test = st.tabs(['Train','Test'])
|
29 |
|
30 |
with train:
|
31 |
-
st.title("Regression/Train data")
|
32 |
spectra = st.file_uploader("**Upload file**", type={"csv", "txt"})
|
33 |
|
34 |
if spectra is not None:
|
@@ -64,6 +61,50 @@ def regressor():
|
|
64 |
|
65 |
st.divider()
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
def NLP():
|
69 |
st.title("Contact Page")
|
@@ -93,7 +134,8 @@ def resume():
|
|
93 |
# Main function to run the app
|
94 |
def main():
|
95 |
st.sidebar.title("Deep Learning/ Data Science/ AI Models")
|
96 |
-
page_options = ["Classification", "Regressor", "NLP", "Image", "Voice", "Video", "LLMs"]
|
|
|
97 |
choice = st.sidebar.radio("Select", page_options)
|
98 |
|
99 |
if choice == "Classification":
|
|
|
1 |
|
2 |
import pandas as pd
|
|
|
|
|
|
|
|
|
3 |
import warnings
|
4 |
import streamlit as st
|
5 |
+
|
|
|
|
|
6 |
from classification import ClassificationModels
|
7 |
+
from regression import RegressionModels
|
8 |
+
|
9 |
warnings.filterwarnings("ignore")
|
10 |
import uuid
|
11 |
import time
|
12 |
|
13 |
|
14 |
+
|
15 |
# data cleaning: https://bank-performance.streamlit.app/
|
16 |
# https://docs.streamlit.io/library/api-reference/layout
|
17 |
|
|
|
22 |
# st.write("Welcome to the Home Page")
|
23 |
|
24 |
def regressor():
|
25 |
+
EDA, train, test = st.tabs(['EDA/Transformation','Train','Test'])
|
26 |
|
27 |
with train:
|
28 |
+
st.title("Regression / Train data")
|
29 |
spectra = st.file_uploader("**Upload file**", type={"csv", "txt"})
|
30 |
|
31 |
if spectra is not None:
|
|
|
61 |
|
62 |
st.divider()
|
63 |
|
64 |
+
# Select models
|
65 |
+
# models_list = [
|
66 |
+
# 'Linear Regression', 'Polynomial Regression', 'Ridge Regression',
|
67 |
+
# 'Lasso Regression', 'ElasticNet Regression', 'Logistic Regression',
|
68 |
+
# 'Decision Tree Regression', 'Random Forest Regression',
|
69 |
+
# 'Gradient Boosting Regression', 'Support Vector Regression (SVR)',
|
70 |
+
# 'XGBoost', 'LightGBM'
|
71 |
+
# ]
|
72 |
+
|
73 |
+
models_list = [
|
74 |
+
'Linear Regression',
|
75 |
+
'Polynomial Regression',
|
76 |
+
'Ridge Regression',
|
77 |
+
'Lasso Regression',
|
78 |
+
'ElasticNet Regression',
|
79 |
+
'Logistic Regression',
|
80 |
+
'Decision Tree Regression',
|
81 |
+
'Random Forest Regression',
|
82 |
+
'Gradient Boosting Regression',
|
83 |
+
'Support Vector Regression (SVR)',
|
84 |
+
'XGBoost',
|
85 |
+
'LightGBM'
|
86 |
+
]
|
87 |
+
|
88 |
+
selected_models = st.multiselect('Select Regression Models', models_list)
|
89 |
+
|
90 |
+
if selected_models:
|
91 |
+
# Initialize RegressionModels class
|
92 |
+
models = RegressionModels()
|
93 |
+
|
94 |
+
# Add data
|
95 |
+
models.add_data(X, y)
|
96 |
+
|
97 |
+
# Split data into training and testing sets
|
98 |
+
models.split_data()
|
99 |
+
|
100 |
+
# Train and evaluate selected models
|
101 |
+
for model_name in selected_models:
|
102 |
+
st.subheader(f"Model: {model_name}")
|
103 |
+
models.fit(model_name)
|
104 |
+
y_pred = models.train(model_name)
|
105 |
+
mse, r2 = models.evaluate(model_name)
|
106 |
+
st.write(f"MSE: {mse}")
|
107 |
+
st.write(f"R-squared: {r2}")
|
108 |
|
109 |
def NLP():
|
110 |
st.title("Contact Page")
|
|
|
134 |
# Main function to run the app
|
135 |
def main():
|
136 |
st.sidebar.title("Deep Learning/ Data Science/ AI Models")
|
137 |
+
# page_options = ["Classification", "Regressor", "NLP", "Image", "Voice", "Video", "LLMs"]
|
138 |
+
page_options = ["Classification", "Regressor", "NLP", "LLMs", "AI"]
|
139 |
choice = st.sidebar.radio("Select", page_options)
|
140 |
|
141 |
if choice == "Classification":
|
regression.py
CHANGED
@@ -9,7 +9,6 @@ from sklearn.metrics import mean_squared_error, r2_score
|
|
9 |
from sklearn.model_selection import train_test_split
|
10 |
from sklearn.model_selection import train_test_split
|
11 |
from xgboost import XGBRegressor
|
12 |
-
|
13 |
from lightgbm import LGBMRegressor
|
14 |
|
15 |
|
|
|
9 |
from sklearn.model_selection import train_test_split
|
10 |
from sklearn.model_selection import train_test_split
|
11 |
from xgboost import XGBRegressor
|
|
|
12 |
from lightgbm import LGBMRegressor
|
13 |
|
14 |
|