FahadAlam commited on
Commit
351771b
1 Parent(s): b58fdfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -18,11 +18,11 @@ def findCorrelation(dataset, target):
18
  print(df)
19
  print("\n")
20
 
21
- d = df.corr()["coma"].to_dict()
22
  print(d)
23
  labels = sorted(d.items(), key=lambda x: x[1], reverse=True)
24
 
25
- del labels[target]
26
 
27
  fig1 = plt.figure()
28
  hm = sns.heatmap(df.corr(), annot = True)
@@ -40,7 +40,7 @@ def findCorrelation(dataset, target):
40
  # use the function regplot to make a scatterplot
41
  sns.regplot(x=labels.keys()[2], y=df[target])
42
 
43
- return labels, fig1, fig2, fig3, fig4
44
 
45
  demo = gr.Interface(fn=findCorrelation, inputs=[gr.File(), 'text'], outputs=[gr.Label(), gr.Plot(), gr.Plot(), gr.Plot(), gr.Plot()], title="Find correlation")
46
  demo.launch(debug=True)
 
18
  print(df)
19
  print("\n")
20
 
21
+ d = df.corr()[target].to_dict()
22
  print(d)
23
  labels = sorted(d.items(), key=lambda x: x[1], reverse=True)
24
 
25
+ d = d.pop(target)
26
 
27
  fig1 = plt.figure()
28
  hm = sns.heatmap(df.corr(), annot = True)
 
40
  # use the function regplot to make a scatterplot
41
  sns.regplot(x=labels.keys()[2], y=df[target])
42
 
43
+ return d, fig1, fig2, fig3, fig4
44
 
45
  demo = gr.Interface(fn=findCorrelation, inputs=[gr.File(), 'text'], outputs=[gr.Label(), gr.Plot(), gr.Plot(), gr.Plot(), gr.Plot()], title="Find correlation")
46
  demo.launch(debug=True)