rameshmoorthy
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,9 @@ import gradio as gr
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
from tempfile import NamedTemporaryFile
|
6 |
import sweetviz as sv
|
7 |
-
from datatile.summary.df import DataFrameSummary
|
|
|
|
|
8 |
|
9 |
|
10 |
def generate_report(file, type):
|
@@ -48,13 +50,29 @@ def generate_report(file, type):
|
|
48 |
temp_file3.write(contents.encode('utf-8'))
|
49 |
temp_file3.close()
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
|
54 |
|
55 |
dfs = DataFrameSummary(df)
|
56 |
|
57 |
-
return temp_file1.name ,temp_file3.name ,dfs.summary()
|
58 |
|
59 |
|
60 |
with gr.Blocks() as cluster:
|
@@ -74,6 +92,7 @@ with gr.Blocks() as cluster:
|
|
74 |
gr.HTML(value="""<h1 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h1>""")
|
75 |
out3=gr.File(label="Download CSV")
|
76 |
with gr.Row():
|
77 |
-
|
78 |
-
|
|
|
79 |
cluster.launch()
|
|
|
4 |
from pydantic_settings import BaseSettings
|
5 |
from tempfile import NamedTemporaryFile
|
6 |
import sweetviz as sv
|
7 |
+
#from datatile.summary.df import DataFrameSummary
|
8 |
+
from autoviz.AutoViz_Class import AutoViz_Class
|
9 |
+
from traceml.summary.df import DataFrameSummary
|
10 |
|
11 |
|
12 |
def generate_report(file, type):
|
|
|
50 |
temp_file3.write(contents.encode('utf-8'))
|
51 |
temp_file3.close()
|
52 |
|
53 |
+
#AUTOVIZ
|
54 |
+
AV = AutoViz_Class()
|
55 |
+
|
56 |
+
dfviz = AV.AutoViz(
|
57 |
+
"",
|
58 |
+
sep=",",
|
59 |
+
depVar=target,
|
60 |
+
dfte=dataframe,
|
61 |
+
header=0,
|
62 |
+
verbose=2,
|
63 |
+
lowess=False,
|
64 |
+
chart_format="jpg",
|
65 |
+
max_rows_analyzed=500,
|
66 |
+
max_cols_analyzed=20,
|
67 |
+
save_plot_dir="plots",
|
68 |
+
)
|
69 |
+
|
70 |
|
71 |
|
72 |
|
73 |
dfs = DataFrameSummary(df)
|
74 |
|
75 |
+
return temp_file1.name ,temp_file3.name ,dfviz,dfs.summary()
|
76 |
|
77 |
|
78 |
with gr.Blocks() as cluster:
|
|
|
92 |
gr.HTML(value="""<h1 style="color: #3399FF; text-shadow: 1px 1px 2px #ddd;">SWEETVIZ REPORT</h1>""")
|
93 |
out3=gr.File(label="Download CSV")
|
94 |
with gr.Row():
|
95 |
+
dataframe1=gr.Dataframe()
|
96 |
+
dataframe2=gr.Dataframe()
|
97 |
+
btn.click(generate_report,inputs=[file],outputs=[out1,out3,dataframe1,dataframe2])
|
98 |
cluster.launch()
|