Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,16 +24,27 @@ def findCorrelation(dataset, target):
|
|
24 |
hm = sns.heatmap(df.corr(), annot = True)
|
25 |
hm.set(title = "Correlation matrix of dataset\n")
|
26 |
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
36 |
return d, fig1, fig2, fig3, fig4
|
37 |
|
|
|
|
|
38 |
demo = gr.Interface(fn=findCorrelation, inputs=[gr.File(), 'text'], outputs=[gr.Label(num_top_classes = 10), gr.Plot(), gr.Plot(), gr.Plot(), gr.Plot()], title="Find correlation")
|
39 |
demo.launch(debug=True)
|
|
|
24 |
hm = sns.heatmap(df.corr(), annot = True)
|
25 |
hm.set(title = "Correlation matrix of dataset\n")
|
26 |
|
27 |
+
try:
|
28 |
+
fig2 = plt.figure()
|
29 |
+
sns.regplot(x=df[keys[0][0]], y=df[target])
|
30 |
+
except:
|
31 |
+
fig2 = plt.figure()
|
32 |
|
33 |
+
try:
|
34 |
+
fig3 = plt.figure()
|
35 |
+
sns.regplot(x=df[keys[1][0]], y=df[target])
|
36 |
+
except:
|
37 |
+
fig3 = plt.figure()
|
38 |
|
39 |
+
try:
|
40 |
+
fig4 = plt.figure()
|
41 |
+
sns.regplot(x=df[keys[2][0]], y=df[target])
|
42 |
+
except:
|
43 |
+
fig4 = plt.figure()
|
44 |
+
|
45 |
return d, fig1, fig2, fig3, fig4
|
46 |
|
47 |
+
examples = [["boston.csv", "MEDV"]]
|
48 |
+
|
49 |
demo = gr.Interface(fn=findCorrelation, inputs=[gr.File(), 'text'], outputs=[gr.Label(num_top_classes = 10), gr.Plot(), gr.Plot(), gr.Plot(), gr.Plot()], title="Find correlation")
|
50 |
demo.launch(debug=True)
|