FahadAlam commited on
Commit
6448874
1 Parent(s): 91c9e0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -9,17 +9,20 @@ def findCorrelation():
9
  df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
10
 
11
  df["target"] = iris.target
12
-
13
  correlation = df["sepal length (cm)"].corr(df["petal length (cm)"])
14
  corr = df.corr()
15
-
 
16
  hm = sns.heatmap(df.corr(), annot = True)
17
  hm.set(xlabel='\nIRIS Flower Details', ylabel='IRIS Flower Details\t', title = "Correlation matrix of IRIS data\n")
18
-
 
19
  # use the function regplot to make a scatterplot
20
  sns.regplot(x=df["sepal length (cm)"], y=df["sepal width (cm)"])
21
  plt.show()
22
- return plt, plt
 
23
 
24
- demo = gr.Interface(fn=findCorrelation, inputs=[], outputs=[gr.Plot(), gr.Plot()], title="Find correlation")
25
  demo.launch()
 
9
  df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
10
 
11
  df["target"] = iris.target
12
+
13
  correlation = df["sepal length (cm)"].corr(df["petal length (cm)"])
14
  corr = df.corr()
15
+
16
+ fig1 = plt.figure()
17
  hm = sns.heatmap(df.corr(), annot = True)
18
  hm.set(xlabel='\nIRIS Flower Details', ylabel='IRIS Flower Details\t', title = "Correlation matrix of IRIS data\n")
19
+
20
+ fig2 = plt.figure()
21
  # use the function regplot to make a scatterplot
22
  sns.regplot(x=df["sepal length (cm)"], y=df["sepal width (cm)"])
23
  plt.show()
24
+
25
+ return fig1, fig2, plt
26
 
27
+ demo = gr.Interface(fn=findCorrelation, inputs=[], outputs=[gr.Plot(), gr.Plot(), gr.Plot()], title="Find correlation")
28
  demo.launch()