Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -50,12 +50,13 @@ print(
|
|
50 |
|
51 |
def plot_lda_pca():
|
52 |
|
53 |
-
fig = plt.figure(1, facecolor="w", figsize=(5,5))
|
|
|
54 |
colors = ["navy", "turquoise", "darkorange"]
|
55 |
lw = 2
|
56 |
|
57 |
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
|
58 |
-
|
59 |
X_r[y == i, 0], X_r[y == i, 1], color=color, alpha=0.8, lw=lw, label=target_name
|
60 |
)
|
61 |
plt.legend(loc="best", shadow=False, scatterpoints=1)
|
@@ -63,7 +64,7 @@ def plot_lda_pca():
|
|
63 |
|
64 |
|
65 |
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
|
66 |
-
|
67 |
X_r2[y == i, 0], X_r2[y == i, 1], alpha=0.8, color=color, label=target_name
|
68 |
)
|
69 |
plt.legend(loc="best", shadow=False, scatterpoints=1)
|
|
|
50 |
|
51 |
def plot_lda_pca():
|
52 |
|
53 |
+
# fig = plt.figure(1, facecolor="w", figsize=(5,5))
|
54 |
+
fig, axes = plt.subplots(2,1, sharey= False, sharex=True, figsize = (5,5))
|
55 |
colors = ["navy", "turquoise", "darkorange"]
|
56 |
lw = 2
|
57 |
|
58 |
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
|
59 |
+
axes[0].scatter(
|
60 |
X_r[y == i, 0], X_r[y == i, 1], color=color, alpha=0.8, lw=lw, label=target_name
|
61 |
)
|
62 |
plt.legend(loc="best", shadow=False, scatterpoints=1)
|
|
|
64 |
|
65 |
|
66 |
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
|
67 |
+
axes[1].scatter(
|
68 |
X_r2[y == i, 0], X_r2[y == i, 1], alpha=0.8, color=color, label=target_name
|
69 |
)
|
70 |
plt.legend(loc="best", shadow=False, scatterpoints=1)
|