FahadAlam commited on
Commit
d1797c8
1 Parent(s): e42834f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -9,13 +9,11 @@ def findCorrelation(dataset, target):
9
  print(dataset.name)
10
 
11
  df = pd.read_csv(dataset.name)
12
-
13
- df["target"] = target
14
 
15
- d = df.corr()['target'].to_dict()
16
  labels = sorted(d.items(), key=lambda x: x[1], reverse=True)
17
 
18
- labels.pop("target")
19
 
20
  fig1 = plt.figure()
21
  hm = sns.heatmap(df.corr(), annot = True)
@@ -23,15 +21,15 @@ def findCorrelation(dataset, target):
23
 
24
  fig2 = plt.figure()
25
  # use the function regplot to make a scatterplot
26
- sns.regplot(x=labels.keys()[0], y=df["target"])
27
 
28
  fig3 = plt.figure()
29
  # use the function regplot to make a scatterplot
30
- sns.regplot(x=labels.keys()[1], y=df["target"])
31
 
32
  fig4 = plt.figure()
33
  # use the function regplot to make a scatterplot
34
- sns.regplot(x=labels.keys()[2], y=df["target"])
35
 
36
  return labels, fig1, fig2, fig3, fig4
37
 
 
9
  print(dataset.name)
10
 
11
  df = pd.read_csv(dataset.name)
 
 
12
 
13
+ d = df.corr()[target].to_dict()
14
  labels = sorted(d.items(), key=lambda x: x[1], reverse=True)
15
 
16
+ labels.pop(target)
17
 
18
  fig1 = plt.figure()
19
  hm = sns.heatmap(df.corr(), annot = True)
 
21
 
22
  fig2 = plt.figure()
23
  # use the function regplot to make a scatterplot
24
+ sns.regplot(x=labels.keys()[0], y=df[target])
25
 
26
  fig3 = plt.figure()
27
  # use the function regplot to make a scatterplot
28
+ sns.regplot(x=labels.keys()[1], y=df[target])
29
 
30
  fig4 = plt.figure()
31
  # use the function regplot to make a scatterplot
32
+ sns.regplot(x=labels.keys()[2], y=df[target])
33
 
34
  return labels, fig1, fig2, fig3, fig4
35