Spaces:
Sleeping
Sleeping
Fix indentation
Browse files
app.py
CHANGED
|
@@ -20,20 +20,20 @@ def fit_plot(n_comp, gamma, alpha):
|
|
| 20 |
ncols=3, figsize=(14, 4)
|
| 21 |
)
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
return fig1
|
| 39 |
|
|
|
|
| 20 |
ncols=3, figsize=(14, 4)
|
| 21 |
)
|
| 22 |
|
| 23 |
+
orig_data_ax.scatter(X_test[:, 0], X_test[:, 1], c=y_test)
|
| 24 |
+
orig_data_ax.set_ylabel("Feature #1")
|
| 25 |
+
orig_data_ax.set_xlabel("Feature #0")
|
| 26 |
+
orig_data_ax.set_title("Testing data")
|
| 27 |
+
|
| 28 |
+
pca_proj_ax.scatter(X_test_pca[:, 0], X_test_pca[:, 1], c=y_test)
|
| 29 |
+
pca_proj_ax.set_ylabel("Principal component #1")
|
| 30 |
+
pca_proj_ax.set_xlabel("Principal component #0")
|
| 31 |
+
pca_proj_ax.set_title("Projection of testing data\n using PCA")
|
| 32 |
+
|
| 33 |
+
kernel_pca_proj_ax.scatter(X_test_kernel_pca[:, 0], X_test_kernel_pca[:, 1], c=y_test)
|
| 34 |
+
kernel_pca_proj_ax.set_ylabel("Principal component #1")
|
| 35 |
+
kernel_pca_proj_ax.set_xlabel("Principal component #0")
|
| 36 |
+
_ = kernel_pca_proj_ax.set_title("Projection of testing data\n using KernelPCA")
|
| 37 |
|
| 38 |
return fig1
|
| 39 |
|