Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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()[
|
16 |
labels = sorted(d.items(), key=lambda x: x[1], reverse=True)
|
17 |
|
18 |
-
labels.pop(
|
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[
|
27 |
|
28 |
fig3 = plt.figure()
|
29 |
# use the function regplot to make a scatterplot
|
30 |
-
sns.regplot(x=labels.keys()[1], y=df[
|
31 |
|
32 |
fig4 = plt.figure()
|
33 |
# use the function regplot to make a scatterplot
|
34 |
-
sns.regplot(x=labels.keys()[2], y=df[
|
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 |
|