Spaces:
Sleeping
Sleeping
harikrishnad1997
commited on
Commit
•
6585a27
1
Parent(s):
6dedae2
Upload 2 files
Browse files- app.py +91 -0
- requirements.txt +313 -0
app.py
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from operator import index
|
2 |
+
import streamlit as st
|
3 |
+
import plotly.express as px
|
4 |
+
import numpy as np
|
5 |
+
from lazypredict.Supervised import LazyRegressor, LazyClassifier
|
6 |
+
from sklearn.model_selection import train_test_split
|
7 |
+
import pandas as pd
|
8 |
+
from autoviz.AutoViz_Class import AutoViz_Class
|
9 |
+
from sklearn.datasets import load_iris
|
10 |
+
import os
|
11 |
+
|
12 |
+
@st.cache_resource
|
13 |
+
def load_data():
|
14 |
+
X, y = load_iris(return_X_y=True)
|
15 |
+
df = pd.DataFrame(X, columns=["sepal_length", "sepal_width", "petal_length", "petal_width"])
|
16 |
+
df['target'] = y
|
17 |
+
return df
|
18 |
+
|
19 |
+
df = load_data()
|
20 |
+
|
21 |
+
with st.sidebar:
|
22 |
+
st.image("https://analyticsindiamag.com/wp-content/uploads/2020/10/lazypredict.jpg")
|
23 |
+
st.title("AutoML")
|
24 |
+
choice = st.radio("Navigation", ["Upload", "Profiling", "Modelling", "Download"])
|
25 |
+
st.info("This project application helps you build and explore your data.")
|
26 |
+
|
27 |
+
if choice == "Upload":
|
28 |
+
st.title("Upload Your Dataset")
|
29 |
+
file = st.file_uploader("Upload Your Dataset")
|
30 |
+
if file:
|
31 |
+
df = pd.read_csv(file, index_col=None)
|
32 |
+
df.to_csv('dataset.csv', index=None)
|
33 |
+
st.dataframe(df)
|
34 |
+
|
35 |
+
if choice == "Profiling":
|
36 |
+
st.title("Exploratory Data Analysis")
|
37 |
+
# AV = AutoViz_Class()
|
38 |
+
# config = {
|
39 |
+
# 'filename': None,
|
40 |
+
# 'sep': ',',
|
41 |
+
# 'depVar': '',
|
42 |
+
# 'dfte': df,
|
43 |
+
# 'header': 0,
|
44 |
+
# 'verbose': 0,
|
45 |
+
# 'lowess': False,
|
46 |
+
# 'chart_format': 'html',
|
47 |
+
# 'max_rows_analyzed': 10000,
|
48 |
+
# 'max_cols_analyzed': 50,
|
49 |
+
# # 'save_plot_path': None,
|
50 |
+
# }
|
51 |
+
# AV.AutoViz()
|
52 |
+
# st.components.v1.html(AV.html, width=1000, height=1000, scrolling=True)
|
53 |
+
|
54 |
+
AV = AutoViz_Class()
|
55 |
+
AV.AutoViz("",dfte=df)
|
56 |
+
report_path = os.path.join(os.path.dirname(__file__), "autoviz_report.html")
|
57 |
+
try:
|
58 |
+
AV.save_html(report_path)
|
59 |
+
HtmlFile = open(report_path, 'r', encoding='utf-8')
|
60 |
+
source_code = HtmlFile.read()
|
61 |
+
st.components.v1.html(source_code, width=1000, height=1000, scrolling=True)
|
62 |
+
except:
|
63 |
+
st.write("Error occurred while generating the AutoViz report.")
|
64 |
+
|
65 |
+
|
66 |
+
if choice == "Modelling":
|
67 |
+
target_options = df.columns.tolist()
|
68 |
+
chosen_target = st.selectbox('Choose the Target Column', target_options)
|
69 |
+
model_type = st.selectbox('Choose Model Type', ['Regression', 'Classification'])
|
70 |
+
if st.button('Run Modelling'):
|
71 |
+
X = df.drop(chosen_target, axis=1)
|
72 |
+
y = df[chosen_target]
|
73 |
+
|
74 |
+
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=65481254)
|
75 |
+
|
76 |
+
if model_type == 'Classification':
|
77 |
+
# Classification
|
78 |
+
clf = LazyClassifier(verbose=0, ignore_warnings=False, custom_metric=None)
|
79 |
+
models, predictions = clf.fit(X_train, X_test, y_train, y_test)
|
80 |
+
model_dictionary = clf.provide_models(X_train, X_test, y_train, y_test)
|
81 |
+
else:
|
82 |
+
# Regression
|
83 |
+
reg = LazyRegressor(verbose=0, ignore_warnings=False, custom_metric=None)
|
84 |
+
models, predictions = reg.fit(X_train, X_test, y_train, y_test)
|
85 |
+
model_dictionary = reg.provide_models(X_train, X_test, y_train, y_test)
|
86 |
+
|
87 |
+
st.dataframe(models)
|
88 |
+
|
89 |
+
if choice == "Download":
|
90 |
+
with open('model_dictionary.pkl', 'wb') as f:
|
91 |
+
st.download_button('Download Model', f, file_name="model_dictionary.pkl")
|
requirements.txt
ADDED
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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backcall==0.2.0
|
17 |
+
beautifulsoup4==4.11.1
|
18 |
+
bleach==5.0.1
|
19 |
+
blinker==1.6.2
|
20 |
+
blis==0.7.9
|
21 |
+
bokeh==2.4.3
|
22 |
+
cachetools==5.3.0
|
23 |
+
catalogue==2.0.8
|
24 |
+
certifi==2022.12.7
|
25 |
+
cffi==1.15.1
|
26 |
+
charset-normalizer==3.1.0
|
27 |
+
click==8.1.3
|
28 |
+
colorama==0.4.6
|
29 |
+
colorcet==3.1.0
|
30 |
+
comm==0.1.2
|
31 |
+
confection==0.0.4
|
32 |
+
contourpy==1.0.7
|
33 |
+
coverage==7.2.7
|
34 |
+
cycler==0.11.0
|
35 |
+
cymem==2.0.7
|
36 |
+
dash==2.10.2
|
37 |
+
dash-core-components==2.0.0
|
38 |
+
dash-html-components==2.0.0
|
39 |
+
dash-table==5.0.0
|
40 |
+
dataclasses-json==0.6.4
|
41 |
+
debugpy==1.6.4
|
42 |
+
decorator==5.1.1
|
43 |
+
defusedxml==0.7.1
|
44 |
+
descartes==1.1.0
|
45 |
+
distlib==0.3.6
|
46 |
+
Django==4.2.1
|
47 |
+
docopt==0.6.2
|
48 |
+
emoji==2.11.0
|
49 |
+
engarde==0.4.0
|
50 |
+
entrypoints==0.4
|
51 |
+
et-xmlfile==1.1.0
|
52 |
+
executing==1.2.0
|
53 |
+
faiss-cpu==1.8.0
|
54 |
+
Faker==24.1.0
|
55 |
+
fastai==2.7.12
|
56 |
+
fastcore==1.5.29
|
57 |
+
fastdownload==0.0.7
|
58 |
+
fastjsonschema==2.16.2
|
59 |
+
fastprogress==1.0.3
|
60 |
+
favicon==0.7.0
|
61 |
+
filelock==3.12.0
|
62 |
+
Flask==2.2.5
|
63 |
+
flatbuffers==23.5.26
|
64 |
+
fonttools==4.39.3
|
65 |
+
fqdn==1.5.1
|
66 |
+
frozenlist==1.3.3
|
67 |
+
fsspec==2024.3.1
|
68 |
+
future==0.18.3
|
69 |
+
gast==0.4.0
|
70 |
+
gitdb==4.0.10
|
71 |
+
GitPython==3.1.31
|
72 |
+
google-auth==2.19.1
|
73 |
+
google-auth-oauthlib==1.0.0
|
74 |
+
google-pasta==0.2.0
|
75 |
+
grpcio==1.54.2
|
76 |
+
h11==0.14.0
|
77 |
+
h2o==3.40.0.4
|
78 |
+
h5py==3.8.0
|
79 |
+
holoviews==1.14.9
|
80 |
+
htbuilder==0.6.2
|
81 |
+
htmlmin==0.1.12
|
82 |
+
hvplot==0.7.3
|
83 |
+
idna==3.4
|
84 |
+
ImageHash==4.3.1
|
85 |
+
importlib-metadata==6.6.0
|
86 |
+
importlib-resources==6.0.0
|
87 |
+
iniconfig==2.0.0
|
88 |
+
install-jdk==1.0.4
|
89 |
+
ipykernel==6.19.3
|
90 |
+
ipython==8.7.0
|
91 |
+
ipython-genutils==0.2.0
|
92 |
+
ipywidgets==8.0.6
|
93 |
+
isoduration==20.11.0
|
94 |
+
itsdangerous==2.1.2
|
95 |
+
jedi==0.18.2
|
96 |
+
Jinja2==3.1.2
|
97 |
+
joblib==1.1.1
|
98 |
+
jsonpatch==1.33
|
99 |
+
jsonpointer==2.3
|
100 |
+
jsonschema==4.17.3
|
101 |
+
jupyter==1.0.0
|
102 |
+
jupyter-console==6.6.3
|
103 |
+
jupyter-events==0.5.0
|
104 |
+
jupyter-server-mathjax==0.2.6
|
105 |
+
jupyter_client==7.4.8
|
106 |
+
jupyter_core==5.1.0
|
107 |
+
jupyter_server==2.0.1
|
108 |
+
jupyter_server_terminals==0.4.3
|
109 |
+
jupyterlab-pygments==0.2.2
|
110 |
+
jupyterlab-widgets==3.0.7
|
111 |
+
kaggle==1.5.13
|
112 |
+
keras==2.13.1rc0
|
113 |
+
kiwisolver==1.4.4
|
114 |
+
langchain==0.1.11
|
115 |
+
langchain-community==0.0.27
|
116 |
+
langchain-core==0.1.30
|
117 |
+
langchain-text-splitters==0.0.1
|
118 |
+
langcodes==3.3.0
|
119 |
+
langsmith==0.1.23
|
120 |
+
lazypredict==0.2.12
|
121 |
+
libclang==16.0.0
|
122 |
+
lightgbm==4.3.0
|
123 |
+
lxml==4.9.2
|
124 |
+
Markdown==3.5.2
|
125 |
+
markdown-it-py==2.2.0
|
126 |
+
markdownlit==0.0.7
|
127 |
+
MarkupSafe==2.1.1
|
128 |
+
marshmallow==3.21.1
|
129 |
+
matplotlib==3.5.3
|
130 |
+
matplotlib-inline==0.1.6
|
131 |
+
mdurl==0.1.2
|
132 |
+
missingno==0.5.2
|
133 |
+
mistune==2.0.4
|
134 |
+
more-itertools==10.2.0
|
135 |
+
mpmath==1.3.0
|
136 |
+
multidict==6.0.4
|
137 |
+
multimethod==1.9.1
|
138 |
+
murmurhash==1.0.9
|
139 |
+
mypy-extensions==1.0.0
|
140 |
+
nbclassic==0.4.8
|
141 |
+
nbclient==0.7.2
|
142 |
+
nbconvert==7.2.7
|
143 |
+
nbdime==3.2.1
|
144 |
+
nbformat==5.7.1
|
145 |
+
nest-asyncio==1.5.6
|
146 |
+
networkx==3.1
|
147 |
+
nltk==3.8.1
|
148 |
+
nolds==0.5.2
|
149 |
+
notebook==6.5.2
|
150 |
+
notebook_shim==0.2.2
|
151 |
+
numpy==1.24.2
|
152 |
+
oauthlib==3.2.2
|
153 |
+
openai==0.27.4
|
154 |
+
openpyxl==3.1.2
|
155 |
+
opt-einsum==3.3.0
|
156 |
+
orjson==3.9.15
|
157 |
+
outcome==1.3.0.post0
|
158 |
+
packaging==24.0
|
159 |
+
pandas==1.5.3
|
160 |
+
pandas-dq==1.29
|
161 |
+
pandas-profiling==3.2.0
|
162 |
+
pandocfilters==1.5.0
|
163 |
+
panel==0.14.4
|
164 |
+
param==1.13.0
|
165 |
+
parso==0.8.3
|
166 |
+
pathspec @ file:///private/tmp/python-pathspec-20231212-4946-k7fih8/pathspec-0.12.1
|
167 |
+
pathy==0.10.1
|
168 |
+
patsy==0.5.3
|
169 |
+
pexpect==4.8.0
|
170 |
+
phik==0.12.3
|
171 |
+
pickleshare==0.7.5
|
172 |
+
Pillow==9.5.0
|
173 |
+
platformdirs @ file:///private/tmp/python-platformdirs-20240130-5151-clzyvt/platformdirs-4.2.0
|
174 |
+
plotly==5.14.1
|
175 |
+
pluggy==1.0.0
|
176 |
+
preshed==3.0.8
|
177 |
+
prometheus-client==0.15.0
|
178 |
+
prompt-toolkit==3.0.36
|
179 |
+
protobuf==3.20.3
|
180 |
+
protonvpn-cli==2.2.6
|
181 |
+
psutil==5.9.4
|
182 |
+
ptyprocess==0.7.0
|
183 |
+
pure-eval==0.2.2
|
184 |
+
py3nvml==0.2.7
|
185 |
+
pyamg==5.1.0
|
186 |
+
pyarrow==12.0.0
|
187 |
+
pyasn1==0.5.0
|
188 |
+
pyasn1-modules==0.3.0
|
189 |
+
pycparser==2.21
|
190 |
+
pyct==0.5.0
|
191 |
+
pydantic==1.10.8
|
192 |
+
pydeck==0.8.1b0
|
193 |
+
Pygments==2.13.0
|
194 |
+
pymdown-extensions==10.7.1
|
195 |
+
Pympler==1.0.1
|
196 |
+
pyparsing==3.0.9
|
197 |
+
PyPDF2==3.0.1
|
198 |
+
pyrsistent==0.19.2
|
199 |
+
PySocks==1.7.1
|
200 |
+
pytest==7.3.1
|
201 |
+
python-dateutil==2.8.2
|
202 |
+
python-dotenv==1.0.0
|
203 |
+
python-json-logger==2.0.4
|
204 |
+
python-slugify==8.0.1
|
205 |
+
pythondialog==3.5.3
|
206 |
+
pytz==2023.3
|
207 |
+
pyviz_comms==3.0.2
|
208 |
+
PyWavelets==1.4.1
|
209 |
+
PyYAML==6.0
|
210 |
+
pyzmq==24.0.1
|
211 |
+
q==2.7
|
212 |
+
qtconsole==5.4.3
|
213 |
+
QtPy==2.3.1
|
214 |
+
radian==0.6.4
|
215 |
+
rchitect==0.3.40
|
216 |
+
regex==2023.12.25
|
217 |
+
requests==2.28.2
|
218 |
+
requests-oauthlib==1.3.1
|
219 |
+
rfc3339-validator==0.1.4
|
220 |
+
rfc3986-validator==0.1.1
|
221 |
+
rich==13.3.5
|
222 |
+
rsa==4.9
|
223 |
+
runipy==0.1.5
|
224 |
+
scikit-learn==1.2.2
|
225 |
+
scikit-plot==0.3.7
|
226 |
+
scipy==1.10.1
|
227 |
+
seaborn==0.12.2
|
228 |
+
selenium==4.18.1
|
229 |
+
Send2Trash==1.8.0
|
230 |
+
shapely==2.0.1
|
231 |
+
six==1.16.0
|
232 |
+
sklearn==0.0.post5
|
233 |
+
smart-open==6.3.0
|
234 |
+
smmap==5.0.0
|
235 |
+
sniffio==1.3.0
|
236 |
+
sortedcontainers==2.4.0
|
237 |
+
soupsieve==2.3.2.post1
|
238 |
+
spacy==3.5.3
|
239 |
+
spacy-legacy==3.0.12
|
240 |
+
spacy-loggers==1.0.4
|
241 |
+
SQLAlchemy==2.0.28
|
242 |
+
sqlparse==0.4.4
|
243 |
+
srsly==2.4.6
|
244 |
+
st-annotated-text==4.0.1
|
245 |
+
stack-data==0.6.2
|
246 |
+
statsmodels==0.14.0
|
247 |
+
stmetrics==0.1.4
|
248 |
+
streamlit==1.22.0
|
249 |
+
streamlit-camera-input-live==0.2.0
|
250 |
+
streamlit-card==1.0.0
|
251 |
+
streamlit-embedcode==0.1.2
|
252 |
+
streamlit-extras==0.4.0
|
253 |
+
streamlit-faker==0.0.3
|
254 |
+
streamlit-image-coordinates==0.1.6
|
255 |
+
streamlit-keyup==0.2.3
|
256 |
+
streamlit-option-menu==0.3.12
|
257 |
+
streamlit-pandas-profiling==0.1.3
|
258 |
+
streamlit-toggle-switch==1.0.2
|
259 |
+
streamlit-vertical-slider==2.5.5
|
260 |
+
sweetviz==2.1.3
|
261 |
+
sympy==1.12
|
262 |
+
tabulate==0.9.0
|
263 |
+
tangled-up-in-unicode==0.2.0
|
264 |
+
tenacity==8.2.2
|
265 |
+
tensorboard==2.13.0
|
266 |
+
tensorboard-data-server==0.7.0
|
267 |
+
tensorflow==2.13.0rc1
|
268 |
+
tensorflow-estimator==2.13.0rc0
|
269 |
+
tensorflow-macos==2.13.0rc1
|
270 |
+
termcolor==2.3.0
|
271 |
+
terminado==0.17.1
|
272 |
+
text-unidecode==1.3
|
273 |
+
textblob==0.18.0.post0
|
274 |
+
thinc==8.1.10
|
275 |
+
threadpoolctl==3.1.0
|
276 |
+
tiktoken==0.6.0
|
277 |
+
tinycss2==1.2.1
|
278 |
+
toml==0.10.2
|
279 |
+
toolz==0.12.0
|
280 |
+
torch==2.0.1
|
281 |
+
torchvision==0.15.2
|
282 |
+
tornado==6.3.2
|
283 |
+
tqdm==4.65.0
|
284 |
+
traitlets==5.8.0
|
285 |
+
trio==0.24.0
|
286 |
+
trio-websocket==0.11.1
|
287 |
+
typer==0.7.0
|
288 |
+
typing-inspect==0.9.0
|
289 |
+
typing_extensions @ file:///private/tmp/python-typing-extensions-20240225-4792-3v2jhm/typing_extensions-4.10.0
|
290 |
+
tzdata==2023.3
|
291 |
+
tzlocal==5.0.1
|
292 |
+
uri-template==1.2.0
|
293 |
+
urllib3==1.26.15
|
294 |
+
validators==0.20.0
|
295 |
+
virtualenv==20.23.0
|
296 |
+
visions==0.7.4
|
297 |
+
wasabi==1.1.1
|
298 |
+
watchdog==3.0.0
|
299 |
+
watermark==2.4.2
|
300 |
+
wcwidth==0.2.5
|
301 |
+
webcolors==1.12
|
302 |
+
webencodings==0.5.1
|
303 |
+
websocket-client==1.4.2
|
304 |
+
Werkzeug==2.2.3
|
305 |
+
widgetsnbextension==4.0.7
|
306 |
+
wordcloud==1.9.3
|
307 |
+
wrapt==1.15.0
|
308 |
+
wsproto==1.2.0
|
309 |
+
xgboost==1.6.2
|
310 |
+
xlrd==2.0.1
|
311 |
+
xmltodict==0.13.0
|
312 |
+
yarl==1.8.2
|
313 |
+
zipp==3.15.0
|