diff --git a/doc/pub/DimRed/html/._DimRed-bs028.html b/doc/pub/DimRed/html/._DimRed-bs028.html new file mode 100644 index 000000000..d3de994a0 --- /dev/null +++ b/doc/pub/DimRed/html/._DimRed-bs028.html @@ -0,0 +1,256 @@ + + +
+ + + + + +
+ + + + +
+ +
+The kernel trick is a mathematical technique that implicitly maps instances into a +very high-dimensional space (called the feature space), enabling nonlinear classification and regression +with Support Vector Machines. Recall that a linear decision boundary in the high-dimensional feature +space corresponds to a complex nonlinear decision boundary in the original space. +It turns out that the same trick can be applied to PCA, making it possible to perform complex nonlinear +projections for dimensionality reduction. This is called Kernel PCA (kPCA). It is often good at +preserving clusters of instances after projection, or sometimes even unrolling datasets that lie close to a +twisted manifold. +For example, the following code uses Scikit-Learn’s KernelPCA class to perform kPCA with an +
+ + +
from sklearn.decomposition import KernelPCA
+rbf_pca = KernelPCA(n_components = 2, kernel="rbf", gamma=0.04)
+X_reduced = rbf_pca.fit_transform(X)
++
+
+ +
+ + +
+ + + + +
+Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction +(NLDR) technique. It is a Manifold Learning technique that does not rely on projections like the previous +algorithms. In a nutshell, LLE works by first measuring how each training instance linearly relates to its +closest neighbors (c.n.), and then looking for a low-dimensional representation of the training set where +these local relationships are best preserved (more details shortly). + +
+
+ +
+ + +
+ + + + +
+There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn. + +
+Here are some of the most popular: + +
+ + +
import numpy as np
+import pandas as pd
+from IPython.display import display
+np.random.seed(100)
+# setting up a 10 x 5 matrix
+rows = 10
+cols = 5
+a = np.random.randn(rows,cols)
+df = pd.DataFrame(a)
+display(df)
+print(df.mean())
+print(df.std())
+display(df**2)
++ +
+ +
+ + +