diff --git a/doc/pub/DimRed/html/._DimRed-bs000.html b/doc/pub/DimRed/html/._DimRed-bs000.html index 701588387..3df86eb8f 100644 --- a/doc/pub/DimRed/html/._DimRed-bs000.html +++ b/doc/pub/DimRed/html/._DimRed-bs000.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -221,7 +223,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs001.html b/doc/pub/DimRed/html/._DimRed-bs001.html index 646de037e..6839f50c7 100644 --- a/doc/pub/DimRed/html/._DimRed-bs001.html +++ b/doc/pub/DimRed/html/._DimRed-bs001.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -221,7 +223,7 @@ data.
  • 10
  • 11
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs002.html b/doc/pub/DimRed/html/._DimRed-bs002.html index 7c58ae0a5..782040d1f 100644 --- a/doc/pub/DimRed/html/._DimRed-bs002.html +++ b/doc/pub/DimRed/html/._DimRed-bs002.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -220,7 +222,7 @@ ensures that all features are exactly between \( 0 \) and \( 1 \). The
  • 11
  • 12
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs003.html b/doc/pub/DimRed/html/._DimRed-bs003.html index ecf0fec24..b8f2304bf 100644 --- a/doc/pub/DimRed/html/._DimRed-bs003.html +++ b/doc/pub/DimRed/html/._DimRed-bs003.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -223,7 +225,7 @@ techniques.
  • 12
  • 13
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs004.html b/doc/pub/DimRed/html/._DimRed-bs004.html index 2b3d89d72..254726105 100644 --- a/doc/pub/DimRed/html/._DimRed-bs004.html +++ b/doc/pub/DimRed/html/._DimRed-bs004.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -298,7 +300,7 @@ svm.fit(X_train_scaled, y_train)
  • 13
  • 14
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs005.html b/doc/pub/DimRed/html/._DimRed-bs005.html index a13ceb4de..80b6dd521 100644 --- a/doc/pub/DimRed/html/._DimRed-bs005.html +++ b/doc/pub/DimRed/html/._DimRed-bs005.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -248,7 +250,7 @@ svm.fit(X_train_scaled, y_train)
  • 14
  • 15
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs006.html b/doc/pub/DimRed/html/._DimRed-bs006.html index e396fae0d..4bde00dfe 100644 --- a/doc/pub/DimRed/html/._DimRed-bs006.html +++ b/doc/pub/DimRed/html/._DimRed-bs006.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -227,7 +229,7 @@ logreg.fit(X_train_scaled, y_train)
  • 15
  • 16
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs007.html b/doc/pub/DimRed/html/._DimRed-bs007.html index 7ca7af225..4c99798ec 100644 --- a/doc/pub/DimRed/html/._DimRed-bs007.html +++ b/doc/pub/DimRed/html/._DimRed-bs007.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -282,7 +284,7 @@ applications.
  • 16
  • 17
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs008.html b/doc/pub/DimRed/html/._DimRed-bs008.html index beaf953d2..29b273d42 100644 --- a/doc/pub/DimRed/html/._DimRed-bs008.html +++ b/doc/pub/DimRed/html/._DimRed-bs008.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -212,7 +214,7 @@ We have a data set defined by a design/feature matrix \( \boldsymbol{X} \) (see
  • 17
  • 18
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs009.html b/doc/pub/DimRed/html/._DimRed-bs009.html index 1c5a84437..0633ff21e 100644 --- a/doc/pub/DimRed/html/._DimRed-bs009.html +++ b/doc/pub/DimRed/html/._DimRed-bs009.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -261,7 +263,7 @@ In the above example this is the function we constructed using pandas.
  • 18
  • 19
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs010.html b/doc/pub/DimRed/html/._DimRed-bs010.html index e04ad4053..d35499f33 100644 --- a/doc/pub/DimRed/html/._DimRed-bs010.html +++ b/doc/pub/DimRed/html/._DimRed-bs010.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -256,7 +258,7 @@ $$
  • 19
  • 20
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs011.html b/doc/pub/DimRed/html/._DimRed-bs011.html index 726ca148a..651f77edc 100644 --- a/doc/pub/DimRed/html/._DimRed-bs011.html +++ b/doc/pub/DimRed/html/._DimRed-bs011.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -244,7 +246,7 @@ C = np.c
  • 20
  • 21
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs012.html b/doc/pub/DimRed/html/._DimRed-bs012.html index e500f7540..8a75b27c5 100644 --- a/doc/pub/DimRed/html/._DimRed-bs012.html +++ b/doc/pub/DimRed/html/._DimRed-bs012.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -246,7 +248,7 @@ The above procedure with numpy can be made more compact if we use pand
  • 21
  • 22
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs013.html b/doc/pub/DimRed/html/._DimRed-bs013.html index af63c221c..aadce9ddc 100644 --- a/doc/pub/DimRed/html/._DimRed-bs013.html +++ b/doc/pub/DimRed/html/._DimRed-bs013.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -228,7 +230,7 @@ We expand this model to the Franke function discussed above.
  • 22
  • 23
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs014.html b/doc/pub/DimRed/html/._DimRed-bs014.html index 14792183d..847ed1de2 100644 --- a/doc/pub/DimRed/html/._DimRed-bs014.html +++ b/doc/pub/DimRed/html/._DimRed-bs014.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -264,7 +266,7 @@ matrix.
  • 23
  • 24
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs015.html b/doc/pub/DimRed/html/._DimRed-bs015.html index 39697340b..5a51c64a1 100644 --- a/doc/pub/DimRed/html/._DimRed-bs015.html +++ b/doc/pub/DimRed/html/._DimRed-bs015.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -244,7 +246,7 @@ It is easy to generalize this to a matrix \( \boldsymbol{X}\in {\mathbb{R}}^{n\t
  • 24
  • 25
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs016.html b/doc/pub/DimRed/html/._DimRed-bs016.html index 35f34ef52..ba3075c88 100644 --- a/doc/pub/DimRed/html/._DimRed-bs016.html +++ b/doc/pub/DimRed/html/._DimRed-bs016.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -213,6 +215,19 @@ $$ In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is \( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \). +

    +The eigenvalues tell us then how much we need to stretch the +corresponding eigenvectors. Dimensions with large eigenvalues have +thus large variations (large variance) and define therefore useful +dimensions. The data points are more spread out in the direction of +these eigenvectors. Smaller eigenvalues mean on the other hand that +the corresponding eigenvectors are shrunk accordingly and the data +points are tightly bunched together and there is not much variation in +these specific directions. Hopefully then we could leave it out +dimensions where the eigenvalues are very small. If \( p \) is very large, +we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \) +features/predictors. +

    @@ -239,7 +254,7 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord

  • 25
  • 26
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs017.html b/doc/pub/DimRed/html/._DimRed-bs017.html index 91740f7d8..91074e516 100644 --- a/doc/pub/DimRed/html/._DimRed-bs017.html +++ b/doc/pub/DimRed/html/._DimRed-bs017.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,7 +180,36 @@ MathJax.Hub.Config({ -

    Classical PCA Theorem

    +

    The Algorithm before theorem

    + +

    +Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. + +

    + +$$ +\boldsymbol{X}=\begin{bmatrix} +x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\ +x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\ +x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\ +\dots & \dots & \dots & \dots \dots & \dots \\ +x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\ +x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\ +\end{bmatrix}, +$$ + + + + +After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.

    @@ -206,7 +237,7 @@ MathJax.Hub.Config({

  • 26
  • 27
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs018.html b/doc/pub/DimRed/html/._DimRed-bs018.html index ee77ea4d8..0e27b1a8b 100644 --- a/doc/pub/DimRed/html/._DimRed-bs018.html +++ b/doc/pub/DimRed/html/._DimRed-bs018.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,7 +180,7 @@ MathJax.Hub.Config({ -

    Prof of the PCA Theorem

    +

    Classical PCA Theorem

    @@ -205,6 +207,8 @@ MathJax.Hub.Config({

  • 26
  • 27
  • 28
  • +
  • ...
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs019.html b/doc/pub/DimRed/html/._DimRed-bs019.html index 30d2d97ef..57a96ad5b 100644 --- a/doc/pub/DimRed/html/._DimRed-bs019.html +++ b/doc/pub/DimRed/html/._DimRed-bs019.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,18 +180,8 @@ MathJax.Hub.Config({ -

    Getting started with PCA

    +

    Prof of the PCA Theorem

    -

    - - -

    # Now add PCA
    -from sklearn.decomposition import PCA
    -pca = PCA(n_components = 2)
    -pca.fit(X_train_scaled)
    -
    -X_pca = pca.transform(X_train_scaled)
    -

    @@ -214,6 +206,7 @@ X_pca = pca.26

  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs020.html b/doc/pub/DimRed/html/._DimRed-bs020.html index e5413a86c..5c47f1973 100644 --- a/doc/pub/DimRed/html/._DimRed-bs020.html +++ b/doc/pub/DimRed/html/._DimRed-bs020.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,38 +180,17 @@ MathJax.Hub.Config({ -

    Principal Component Analysis

    -
    -
    -

    -Principal Component Analysis (PCA) is by far the most popular dimensionality reduction algorithm. -First it identifies the hyperplane that lies closest to the data, and then it projects the data onto it. +

    Getting started with PCA

    -

    -The following Python code uses NumPy’s svd() function to obtain all the principal components of the -training set, then extracts the first two principal components

    -

    X_centered = X - X.mean(axis=0)
    -U, s, V = np.linalg.svd(X_centered)
    -c1 = V.T[:, 0]
    -c2 = V.T[:, 1]
    -
    -

    -PCA assumes that the dataset is centered around the origin. Scikit-Learn’s PCA classes take care of centering -the data for you. However, if you implement PCA yourself (as in the preceding example), or if you use other libraries, don’t -forget to center the data first. +

    # Now add PCA
    +from sklearn.decomposition import PCA
    +pca = PCA(n_components = 2)
    +pca.fit(X_train_scaled)
     
    -

    -Once you have identified all the principal components, you can reduce the dimensionality of the dataset -down to \( d \) dimensions by projecting it onto the hyperplane defined by the first \( d \) principal components. -Selecting this hyperplane ensures that the projection will preserve as much variance as possible. -

    - - -

    W2 = V.T[:, :2]
    -X2D = X_centered.dot(W2)
    +X_pca = pca.transform(X_train_scaled)
     

    @@ -234,6 +215,7 @@ X2D = X_centered26

  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs021.html b/doc/pub/DimRed/html/._DimRed-bs021.html index 01c56dc53..ede6d1c65 100644 --- a/doc/pub/DimRed/html/._DimRed-bs021.html +++ b/doc/pub/DimRed/html/._DimRed-bs021.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -176,36 +178,41 @@ MathJax.Hub.Config({

     

     

     

    - + -

    PCA and scikit-learn

    +

    Principal Component Analysis

    +
    +
    +

    +Principal Component Analysis (PCA) is by far the most popular dimensionality reduction algorithm. +First it identifies the hyperplane that lies closest to the data, and then it projects the data onto it.

    -Scikit-Learn’s PCA class implements PCA using SVD decomposition just like we did before. The -following code applies PCA to reduce the dimensionality of the dataset down to two dimensions (note -that it automatically takes care of centering the data): +The following Python code uses NumPy’s svd() function to obtain all the principal components of the +training set, then extracts the first two principal components

    -

    from sklearn.decomposition import PCA
    -pca = PCA(n_components = 2)
    -X2D = pca.fit_transform(X)
    +
    X_centered = X - X.mean(axis=0)
    +U, s, V = np.linalg.svd(X_centered)
    +c1 = V.T[:, 0]
    +c2 = V.T[:, 1]
     

    -After fitting the PCA transformer to the dataset, you can access the principal components using the -components variable (note that it contains the PCs as horizontal vectors, so, for example, the first -principal component is equal to +PCA assumes that the dataset is centered around the origin. Scikit-Learn’s PCA classes take care of centering +the data for you. However, if you implement PCA yourself (as in the preceding example), or if you use other libraries, don’t +forget to center the data first. + +

    +Once you have identified all the principal components, you can reduce the dimensionality of the dataset +down to \( d \) dimensions by projecting it onto the hyperplane defined by the first \( d \) principal components. +Selecting this hyperplane ensures that the projection will preserve as much variance as possible.

    -

    pca.components_.T[:, 0]).
    +
    W2 = V.T[:, :2]
    +X2D = X_centered.dot(W2)
     
    -

    -Another very useful piece of information is the explained variance ratio of each principal component, -available via the \( explained\_variance\_ratio \) variable. It indicates the proportion of the dataset’s -variance that lies along the axis of each principal component. -More material to come here. -

    @@ -228,6 +235,7 @@ More material to come here.

  • 26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs022.html b/doc/pub/DimRed/html/._DimRed-bs022.html index afb778037..2b727e37e 100644 --- a/doc/pub/DimRed/html/._DimRed-bs022.html +++ b/doc/pub/DimRed/html/._DimRed-bs022.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -176,35 +178,36 @@ MathJax.Hub.Config({

     

     

     

    - + -

    More on the PCA

    +

    PCA and scikit-learn

    -Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to -choose the number of dimensions that add up to a sufficiently large portion of the variance (e.g., 95%). -Unless, of course, you are reducing dimensionality for data visualization — in that case you will -generally want to reduce the dimensionality down to 2 or 3. -The following code computes PCA without reducing dimensionality, then computes the minimum number -of dimensions required to preserve 95% of the training set’s variance: +Scikit-Learn’s PCA class implements PCA using SVD decomposition just like we did before. The +following code applies PCA to reduce the dimensionality of the dataset down to two dimensions (note +that it automatically takes care of centering the data):

    -

    pca = PCA()
    -pca.fit(X)
    -cumsum = np.cumsum(pca.explained_variance_ratio_)
    -d = np.argmax(cumsum >= 0.95) + 1
    +
    from sklearn.decomposition import PCA
    +pca = PCA(n_components = 2)
    +X2D = pca.fit_transform(X)
     

    -You could then set \( n\_components=d \) and run PCA again. However, there is a much better option: instead -of specifying the number of principal components you want to preserve, you can set \( n\_components \) to be -a float between 0.0 and 1.0, indicating the ratio of variance you wish to preserve: +After fitting the PCA transformer to the dataset, you can access the principal components using the +components variable (note that it contains the PCs as horizontal vectors, so, for example, the first +principal component is equal to

    -

    pca = PCA(n_components=0.95)
    -X_reduced = pca.fit_transform(X)
    +
    pca.components_.T[:, 0]).
     
    +

    +Another very useful piece of information is the explained variance ratio of each principal component, +available via the \( explained\_variance\_ratio \) variable. It indicates the proportion of the dataset’s +variance that lies along the axis of each principal component. +More material to come here. +

    @@ -226,6 +229,7 @@ X_reduced = pca

  • 26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs023.html b/doc/pub/DimRed/html/._DimRed-bs023.html index dbe918b73..72d6189cd 100644 --- a/doc/pub/DimRed/html/._DimRed-bs023.html +++ b/doc/pub/DimRed/html/._DimRed-bs023.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,15 +180,33 @@ MathJax.Hub.Config({ -

    Incremental PCA

    +

    More on the PCA

    -One problem with the preceding implementation of PCA is that it requires the whole training set to fit in -memory in order for the SVD algorithm to run. Fortunately, Incremental PCA (IPCA) algorithms have -been developed: you can split the training set into mini-batches and feed an IPCA algorithm one minibatch -at a time. This is useful for large training sets, and also to apply PCA online (i.e., on the fly, as new -instances arrive). +Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to +choose the number of dimensions that add up to a sufficiently large portion of the variance (e.g., 95%). +Unless, of course, you are reducing dimensionality for data visualization — in that case you will +generally want to reduce the dimensionality down to 2 or 3. +The following code computes PCA without reducing dimensionality, then computes the minimum number +of dimensions required to preserve 95% of the training set’s variance: +

    + +

    pca = PCA()
    +pca.fit(X)
    +cumsum = np.cumsum(pca.explained_variance_ratio_)
    +d = np.argmax(cumsum >= 0.95) + 1
    +
    +

    +You could then set \( n\_components=d \) and run PCA again. However, there is a much better option: instead +of specifying the number of principal components you want to preserve, you can set \( n\_components \) to be +a float between 0.0 and 1.0, indicating the ratio of variance you wish to preserve: +

    + + +

    pca = PCA(n_components=0.95)
    +X_reduced = pca.fit_transform(X)
    +

    @@ -207,6 +227,7 @@ instances arrive).

  • 26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs024.html b/doc/pub/DimRed/html/._DimRed-bs024.html index 471ff293c..9c87e99a1 100644 --- a/doc/pub/DimRed/html/._DimRed-bs024.html +++ b/doc/pub/DimRed/html/._DimRed-bs024.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,18 +180,14 @@ MathJax.Hub.Config({ -

    Randomized PCA

    +

    Incremental PCA

    -Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic -algorithm that quickly finds an approximation of the first d principal components. Its computational -complexity is \( O(m \times d^2)+O(d^3) \), instead of \( O(m \times n^2) + O(n^3) \), so it is dramatically faster than the -previous algorithms when \( d \) is much smaller than \( n \). - -

    -

    -
    - +One problem with the preceding implementation of PCA is that it requires the whole training set to fit in +memory in order for the SVD algorithm to run. Fortunately, Incremental PCA (IPCA) algorithms have +been developed: you can split the training set into mini-batches and feed an IPCA algorithm one minibatch +at a time. This is useful for large training sets, and also to apply PCA online (i.e., on the fly, as new +instances arrive).

    @@ -210,6 +208,7 @@ previous algorithms when \( d \) is much smaller than \( n \).

  • 26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs025.html b/doc/pub/DimRed/html/._DimRed-bs025.html index 1f84c5fec..8da2c7966 100644 --- a/doc/pub/DimRed/html/._DimRed-bs025.html +++ b/doc/pub/DimRed/html/._DimRed-bs025.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,28 +180,14 @@ MathJax.Hub.Config({ -

    Kernel PCA

    -
    -
    -

    +

    Randomized PCA

    -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 -

    +Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic +algorithm that quickly finds an approximation of the first d principal components. Its computational +complexity is \( O(m \times d^2)+O(d^3) \), instead of \( O(m \times n^2) + O(n^3) \), so it is dramatically faster than the +previous algorithms when \( d \) is much smaller than \( n \). - -

    from sklearn.decomposition import KernelPCA
    -rbf_pca = KernelPCA(n_components = 2, kernel="rbf", gamma=0.04)
    -X_reduced = rbf_pca.fit_transform(X)
    -

    @@ -223,6 +211,7 @@ X_reduced = rbf_pca26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs026.html b/doc/pub/DimRed/html/._DimRed-bs026.html index c3bcffb10..52f5488e9 100644 --- a/doc/pub/DimRed/html/._DimRed-bs026.html +++ b/doc/pub/DimRed/html/._DimRed-bs026.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,14 +180,32 @@ MathJax.Hub.Config({ -

    LLE

    +

    Kernel PCA

    +
    +
    +

    -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). +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)
    +
    +

    +

    +
    +

    @@ -204,6 +224,7 @@ these local relationships are best preserved (more details shortly).

  • 26
  • 27
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/._DimRed-bs027.html b/doc/pub/DimRed/html/._DimRed-bs027.html index 6bb35afea..ca75ce89c 100644 --- a/doc/pub/DimRed/html/._DimRed-bs027.html +++ b/doc/pub/DimRed/html/._DimRed-bs027.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -178,77 +180,16 @@ MathJax.Hub.Config({ -

    Other techniques

    +

    LLE

    -There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn. +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).

    -Here are some of the most popular: - -

      -
    • Multidimensional Scaling (MDS) reduces dimensionality while trying to preserve the distances between the instances.
    • -
    • Isomap creates a graph by connecting each instance to its nearest neighbors, then reduces dimensionality while trying to preserve the geodesic distances between the instances.
    • -
    • t-Distributed Stochastic Neighbor Embedding (t-SNE) reduces dimensionality while trying to keep similar instances close and dissimilar instances apart. It is mostly used for visualization, in particular to visualize clusters of instances in high-dimensional space (e.g., to visualize the MNIST images in 2D).
    • -
    • Linear Discriminant Analysis (LDA) is actually a classification algorithm, but during training it learns the most discriminative axes between the classes, and these axes can then be used to define a hyperplane onto which to project the data. The benefit is that the projection will keep classes as far apart as possible, so LDA is a good technique to reduce dimensionality before running another classification algorithm such as a Support Vector Machine (SVM) classifier discussed in the SVM lectures.
    • -
    - -Here are other examples where we use the DataFrame functionality to handle arrays, now with more interesting features for us, namely numbers. We set up a matrix -of dimensionality \( 10\times 5 \) and compute the mean value and standard deviation of each column. Similarly, we can perform mathematial operations like squaring the matrix elements and many other operations. -

    - - -

    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)
    -
    -

    -Thereafter we can select specific columns only and plot final results -

    - - -

    df.columns = ['First', 'Second', 'Third', 'Fourth', 'Fifth']
    -df.index = np.arange(10)
    -
    -display(df)
    -print(df['Second'].mean() )
    -print(df.info())
    -print(df.describe())
    -
    -from pylab import plt, mpl
    -plt.style.use('seaborn')
    -mpl.rcParams['font.family'] = 'serif'
    -
    -df.cumsum().plot(lw=2.0, figsize=(10,6))
    -plt.show()
    -
    -
    -df.plot.bar(figsize=(10,6), rot=15)
    -plt.show()
    -
    -

    -We can produce a \( 4\times 4 \) matrix -

    - - -

    b = np.arange(16).reshape((4,4))
    -print(b)
    -df1 = pd.DataFrame(b)
    -print(df1)
    -
    -

    -and many other operations. -

      @@ -264,6 +205,8 @@ and many other operations.
    • 26
    • 27
    • 28
    • +
    • 29
    • +
    • »
    diff --git a/doc/pub/DimRed/html/DimRed-bs.html b/doc/pub/DimRed/html/DimRed-bs.html index 701588387..3df86eb8f 100644 --- a/doc/pub/DimRed/html/DimRed-bs.html +++ b/doc/pub/DimRed/html/DimRed-bs.html @@ -88,17 +88,18 @@ Automatically generated HTML file from DocOnce source None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -152,17 +153,18 @@ MathJax.Hub.Config({
  • Correlation Matrix with Pandas and the Franke function
  • Rewriting the Covariance and/or Correlation Matrix
  • Towards the PCA theorem
  • -
  • Classical PCA Theorem
  • -
  • Prof of the PCA Theorem
  • -
  • Getting started with PCA
  • -
  • Principal Component Analysis
  • -
  • PCA and scikit-learn
  • -
  • More on the PCA
  • -
  • Incremental PCA
  • -
  • Randomized PCA
  • -
  • Kernel PCA
  • -
  • LLE
  • -
  • Other techniques
  • +
  • The Algorithm before the Theorem
  • +
  • Classical PCA Theorem
  • +
  • Prof of the PCA Theorem
  • +
  • Getting started with PCA
  • +
  • Principal Component Analysis
  • +
  • PCA and scikit-learn
  • +
  • More on the PCA
  • +
  • Incremental PCA
  • +
  • Randomized PCA
  • +
  • Kernel PCA
  • +
  • LLE
  • +
  • Other techniques
  • @@ -221,7 +223,7 @@ MathJax.Hub.Config({
  • 9
  • 10
  • ...
  • -
  • 28
  • +
  • 29
  • »
  • diff --git a/doc/pub/DimRed/html/DimRed-reveal.html b/doc/pub/DimRed/html/DimRed-reveal.html index d17f342fa..221d0834e 100644 --- a/doc/pub/DimRed/html/DimRed-reveal.html +++ b/doc/pub/DimRed/html/DimRed-reveal.html @@ -936,21 +936,70 @@ $$

    In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is \( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \). + +

    +The eigenvalues tell us then how much we need to stretch the +corresponding eigenvectors. Dimensions with large eigenvalues have +thus large variations (large variance) and define therefore useful +dimensions. The data points are more spread out in the direction of +these eigenvectors. Smaller eigenvalues mean on the other hand that +the corresponding eigenvectors are shrunk accordingly and the data +points are tightly bunched together and there is not much variation in +these specific directions. Hopefully then we could leave it out +dimensions where the eigenvalues are very small. If \( p \) is very large, +we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \) +features/predictors.

    -

    Classical PCA Theorem

    +

    The Algorithm before theorem

    + +

    +Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. + +

      +

    • Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.
    • +
    +

     
    +$$ +\boldsymbol{X}=\begin{bmatrix} +x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\ +x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\ +x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\ +\dots & \dots & \dots & \dots \dots & \dots \\ +x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\ +x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\ +\end{bmatrix}, +$$ +

     
    + + +

      +

    • Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).
    • +

    • Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].
    • +

    • Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).
    • +

    • Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.
    • +

    • Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.
    • +
    +

    + +After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.

    -

    Prof of the PCA Theorem

    +

    Classical PCA Theorem

    -

    Getting started with PCA

    +

    Prof of the PCA Theorem

    +
    + + +
    +

    Getting started with PCA

    @@ -966,7 +1015,7 @@ X_pca = pca.transform(X_train_scaled)

    -

    Principal Component Analysis

    +

    Principal Component Analysis

    @@ -1003,7 +1052,7 @@ X2D = X_centered.dot(W2)

    -

    PCA and scikit-learn

    +

    PCA and scikit-learn

    Scikit-Learn’s PCA class implements PCA using SVD decomposition just like we did before. The @@ -1034,7 +1083,7 @@ More material to come here.

    -

    More on the PCA

    +

    More on the PCA

    Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to @@ -1065,7 +1114,7 @@ X_reduced = pca.fit_transform(X)

    -

    Incremental PCA

    +

    Incremental PCA

    One problem with the preceding implementation of PCA is that it requires the whole training set to fit in @@ -1077,7 +1126,7 @@ instances arrive).

    -

    Randomized PCA

    +

    Randomized PCA

    Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic @@ -1091,7 +1140,7 @@ previous algorithms when \( d \) is much smaller than \( n \).

    -

    Kernel PCA

    +

    Kernel PCA

    @@ -1117,7 +1166,7 @@ X_reduced = rbf_pca.fit_transform(X)

    -

    LLE

    +

    LLE

    Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction @@ -1129,7 +1178,7 @@ these local relationships are best preserved (more details shortly).

    -

    Other techniques

    +

    Other techniques

    There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn. diff --git a/doc/pub/DimRed/html/DimRed-solarized.html b/doc/pub/DimRed/html/DimRed-solarized.html index 959e73c3b..006dc5c14 100644 --- a/doc/pub/DimRed/html/DimRed-solarized.html +++ b/doc/pub/DimRed/html/DimRed-solarized.html @@ -108,17 +108,18 @@ div { text-align: justify; text-justify: inter-word; } None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -903,19 +904,66 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord \( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).

    -









    - -

    Classical PCA Theorem

    +The eigenvalues tell us then how much we need to stretch the +corresponding eigenvectors. Dimensions with large eigenvalues have +thus large variations (large variance) and define therefore useful +dimensions. The data points are more spread out in the direction of +these eigenvectors. Smaller eigenvalues mean on the other hand that +the corresponding eigenvectors are shrunk accordingly and the data +points are tightly bunched together and there is not much variation in +these specific directions. Hopefully then we could leave it out +dimensions where the eigenvalues are very small. If \( p \) is very large, +we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \) +features/predictors.











    -

    Prof of the PCA Theorem

    +

    The Algorithm before theorem

    + +

    +Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. + +

      +
    • Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.
    • +
    + +$$ +\boldsymbol{X}=\begin{bmatrix} +x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\ +x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\ +x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\ +\dots & \dots & \dots & \dots \dots & \dots \\ +x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\ +x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\ +\end{bmatrix}, +$$ + + +
      +
    • Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).
    • +
    • Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].
    • +
    • Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).
    • +
    • Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.
    • +
    • Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.
    • +
    + +After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.











    -

    Getting started with PCA

    +

    Classical PCA Theorem

    + +

    +









    + +

    Prof of the PCA Theorem

    + +

    +









    + +

    Getting started with PCA

    @@ -930,7 +978,7 @@ X_pca = pca.transform(X_train_scaled)











    -

    Principal Component Analysis

    +

    Principal Component Analysis

    @@ -966,7 +1014,7 @@ X2D = X_centered.dot(W2)

    -

    PCA and scikit-learn

    +

    PCA and scikit-learn

    Scikit-Learn’s PCA class implements PCA using SVD decomposition just like we did before. The @@ -997,7 +1045,7 @@ More material to come here.











    -

    More on the PCA

    +

    More on the PCA

    Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to @@ -1027,7 +1075,7 @@ X_reduced = pca.fit_transform(X)











    -

    Incremental PCA

    +

    Incremental PCA

    One problem with the preceding implementation of PCA is that it requires the whole training set to fit in @@ -1039,7 +1087,7 @@ instances arrive).











    -

    Randomized PCA

    +

    Randomized PCA

    Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic @@ -1054,7 +1102,7 @@ previous algorithms when \( d \) is much smaller than \( n \).











    -

    Kernel PCA

    +

    Kernel PCA

    @@ -1083,7 +1131,7 @@ X_reduced = rbf_pca.fit_transform(X)











    -

    LLE

    +

    LLE

    Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction @@ -1095,7 +1143,7 @@ these local relationships are best preserved (more details shortly).











    -

    Other techniques

    +

    Other techniques

    There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn. diff --git a/doc/pub/DimRed/html/DimRed.html b/doc/pub/DimRed/html/DimRed.html index f30d112ee..f6e2efdb3 100644 --- a/doc/pub/DimRed/html/DimRed.html +++ b/doc/pub/DimRed/html/DimRed.html @@ -113,17 +113,18 @@ div { text-align: justify; text-justify: inter-word; } None, '___sec14'), ('Towards the PCA theorem', 2, None, '___sec15'), - ('Classical PCA Theorem', 2, None, '___sec16'), - ('Prof of the PCA Theorem', 2, None, '___sec17'), - ('Getting started with PCA', 2, None, '___sec18'), - ('Principal Component Analysis', 2, None, '___sec19'), - ('PCA and scikit-learn', 2, None, '___sec20'), - ('More on the PCA', 2, None, '___sec21'), - ('Incremental PCA', 2, None, '___sec22'), - ('Randomized PCA', 2, None, '___sec23'), - ('Kernel PCA', 2, None, '___sec24'), - ('LLE', 2, None, '___sec25'), - ('Other techniques', 2, None, '___sec26')]} + ('The Algorithm before the Theorem', 2, None, '___sec16'), + ('Classical PCA Theorem', 2, None, '___sec17'), + ('Prof of the PCA Theorem', 2, None, '___sec18'), + ('Getting started with PCA', 2, None, '___sec19'), + ('Principal Component Analysis', 2, None, '___sec20'), + ('PCA and scikit-learn', 2, None, '___sec21'), + ('More on the PCA', 2, None, '___sec22'), + ('Incremental PCA', 2, None, '___sec23'), + ('Randomized PCA', 2, None, '___sec24'), + ('Kernel PCA', 2, None, '___sec25'), + ('LLE', 2, None, '___sec26'), + ('Other techniques', 2, None, '___sec27')]} end of tocinfo --> @@ -908,19 +909,66 @@ In the derivation of the PCA theorem we will assume that the eigenvalues are ord \( \lambda_0 > \lambda_1 > \dots > \lambda_{p-1} \).

    -









    - -

    Classical PCA Theorem

    +The eigenvalues tell us then how much we need to stretch the +corresponding eigenvectors. Dimensions with large eigenvalues have +thus large variations (large variance) and define therefore useful +dimensions. The data points are more spread out in the direction of +these eigenvectors. Smaller eigenvalues mean on the other hand that +the corresponding eigenvectors are shrunk accordingly and the data +points are tightly bunched together and there is not much variation in +these specific directions. Hopefully then we could leave it out +dimensions where the eigenvalues are very small. If \( p \) is very large, +we could then aim at reducing \( p \) to \( l < < p \) and handle only \( l \) +features/predictors.











    -

    Prof of the PCA Theorem

    +

    The Algorithm before theorem

    + +

    +Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. + +

      +
    • Set up the datapoints for the design/feature matrix \( \boldsymbol{X} \) with \( \boldsymbol{X}\in {\mathbb{R}}^{n\times p} \), with the predictors/features \( p \) referring to the column numbers and the entries \( n \) being the row elements.
    • +
    + +$$ +\boldsymbol{X}=\begin{bmatrix} +x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\ +x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\ +x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\ +\dots & \dots & \dots & \dots \dots & \dots \\ +x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\ +x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\ +\end{bmatrix}, +$$ + + +
      +
    • Center the data by subtracting the mean value for each column. This leads to a new matrix \( \boldsymbol{X}\rightarrow \overline{\boldsymbol{X}} \).
    • +
    • Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\boldsymbol{X}}\overline{\boldsymbol{X}}^T].
    • +
    • Find the eigenpairs of \( \boldsymbol{C} \) with eigenvalues \( [\lambda_0,\lambda_1,\dots,\lambda_{p-1}] \) and eigenvectors \( [\boldsymbol{s}_0,\boldsymbol{s}_1,\dots,\boldsymbol{s}_{p-1}] \).
    • +
    • Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.
    • +
    • Keep only those \( l \) eigenvalues larger than a selected threshold value, discarding thus \( p-l \) features since we expect small variations in the data here.
    • +
    + +After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.











    -

    Getting started with PCA

    +

    Classical PCA Theorem

    + +

    +









    + +

    Prof of the PCA Theorem

    + +

    +









    + +

    Getting started with PCA

    @@ -935,7 +983,7 @@ X_pca = pca.









    -

    Principal Component Analysis

    +

    Principal Component Analysis

    @@ -971,7 +1019,7 @@ X2D = X_centered -

    PCA and scikit-learn

    +

    PCA and scikit-learn

    Scikit-Learn’s PCA class implements PCA using SVD decomposition just like we did before. The @@ -1002,7 +1050,7 @@ More material to come here.











    -

    More on the PCA

    +

    More on the PCA

    Instead of arbitrarily choosing the number of dimensions to reduce down to, it is generally preferable to @@ -1032,7 +1080,7 @@ X_reduced = pca











    -

    Incremental PCA

    +

    Incremental PCA

    One problem with the preceding implementation of PCA is that it requires the whole training set to fit in @@ -1044,7 +1092,7 @@ instances arrive).











    -

    Randomized PCA

    +

    Randomized PCA

    Scikit-Learn offers yet another option to perform PCA, called Randomized PCA. This is a stochastic @@ -1059,7 +1107,7 @@ previous algorithms when \( d \) is much smaller than \( n \).











    -

    Kernel PCA

    +

    Kernel PCA

    @@ -1088,7 +1136,7 @@ X_reduced = rbf_pcaLLE +

    LLE

    Locally Linear Embedding (LLE) is another very powerful nonlinear dimensionality reduction @@ -1100,7 +1148,7 @@ these local relationships are best preserved (more details shortly).











    -

    Other techniques

    +

    Other techniques

    There are many other dimensionality reduction techniques, several of which are available in Scikit-Learn. diff --git a/doc/pub/DimRed/ipynb/DimRed.ipynb b/doc/pub/DimRed/ipynb/DimRed.ipynb index f2c182c39..538fd7b6f 100644 --- a/doc/pub/DimRed/ipynb/DimRed.ipynb +++ b/doc/pub/DimRed/ipynb/DimRed.ipynb @@ -1000,6 +1000,57 @@ "In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is\n", "$\\lambda_0 > \\lambda_1 > \\dots > \\lambda_{p-1}$. \n", "\n", + "\n", + "The eigenvalues tell us then how much we need to stretch the\n", + "corresponding eigenvectors. Dimensions with large eigenvalues have\n", + "thus large variations (large variance) and define therefore useful\n", + "dimensions. The data points are more spread out in the direction of\n", + "these eigenvectors. Smaller eigenvalues mean on the other hand that\n", + "the corresponding eigenvectors are shrunk accordingly and the data\n", + "points are tightly bunched together and there is not much variation in\n", + "these specific directions. Hopefully then we could leave it out\n", + "dimensions where the eigenvalues are very small. If $p$ is very large,\n", + "we could then aim at reducing $p$ to $l << p$ and handle only $l$\n", + "features/predictors.\n", + "\n", + "## The Algorithm before theorem\n", + "\n", + "Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. \n", + "* Set up the datapoints for the design/feature matrix $\\boldsymbol{X}$ with $\\boldsymbol{X}\\in {\\mathbb{R}}^{n\\times p}$, with the predictors/features $p$ referring to the column numbers and the entries $n$ being the row elements." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "$$\n", + "\\boldsymbol{X}=\\begin{bmatrix}\n", + "x_{0,0} & x_{0,1} & x_{0,2}& \\dots & \\dots x_{0,p-1}\\\\\n", + "x_{1,0} & x_{1,1} & x_{1,2}& \\dots & \\dots x_{1,p-1}\\\\\n", + "x_{2,0} & x_{2,1} & x_{2,2}& \\dots & \\dots x_{2,p-1}\\\\\n", + "\\dots & \\dots & \\dots & \\dots \\dots & \\dots \\\\\n", + "x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \\dots & \\dots x_{n-2,p-1}\\\\\n", + "x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \\dots & \\dots x_{n-1,p-1}\\\\\n", + "\\end{bmatrix},\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Center the data by subtracting the mean value for each column. This leads to a new matrix $\\boldsymbol{X}\\rightarrow \\overline{\\boldsymbol{X}}$.\n", + "\n", + "* Compute then the covariance/correlation matrix $\\mathbb{E}[\\overline{\\boldsymbol{X}}\\overline{\\boldsymbol{X}}^T].\n", + "\n", + "* Find the eigenpairs of $\\boldsymbol{C}$ with eigenvalues $[\\lambda_0,\\lambda_1,\\dots,\\lambda_{p-1}]$ and eigenvectors $[\\boldsymbol{s}_0,\\boldsymbol{s}_1,\\dots,\\boldsymbol{s}_{p-1}]$.\n", + "\n", + "* Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues.\n", + "\n", + "* Keep only those $l$ eigenvalues larger than a selected threshold value, discarding thus $p-l$ features since we expect small variations in the data here.\n", + "\n", + "After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction.\n", + "\n", "## Classical PCA Theorem\n", "\n", "\n", diff --git a/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz b/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz index 0eef6c592..554bc3eba 100644 Binary files a/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz and b/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz differ diff --git a/doc/pub/DimRed/pdf/DimRed-minted.pdf b/doc/pub/DimRed/pdf/DimRed-minted.pdf index 035ad9731..6ae259989 100644 Binary files a/doc/pub/DimRed/pdf/DimRed-minted.pdf and b/doc/pub/DimRed/pdf/DimRed-minted.pdf differ diff --git a/doc/src/DimRed/DimRed.do.txt b/doc/src/DimRed/DimRed.do.txt index 3db103be5..a7124c982 100644 --- a/doc/src/DimRed/DimRed.do.txt +++ b/doc/src/DimRed/DimRed.do.txt @@ -703,6 +703,44 @@ and since $\bm{C}[\bm{y}]$ is diagonal we have for a given eigenvalue $i$ of the In the derivation of the PCA theorem we will assume that the eigenvalues are ordered in descending order, that is $\lambda_0 > \lambda_1 > \dots > \lambda_{p-1}$. + +The eigenvalues tell us then how much we need to stretch the +corresponding eigenvectors. Dimensions with large eigenvalues have +thus large variations (large variance) and define therefore useful +dimensions. The data points are more spread out in the direction of +these eigenvectors. Smaller eigenvalues mean on the other hand that +the corresponding eigenvectors are shrunk accordingly and the data +points are tightly bunched together and there is not much variation in +these specific directions. Hopefully then we could leave it out +dimensions where the eigenvalues are very small. If $p$ is very large, +we could then aim at reducing $p$ to $l << p$ and handle only $l$ +features/predictors. + +!split +===== The Algorithm before the Theorem ===== + +Here's how we would proceed in setting up the algorithm for the PCA, see also discussion below here. +* Set up the datapoints for the design/feature matrix $\bm{X}$ with $\bm{X}\in {\mathbb{R}}^{n\times p}$, with the predictors/features $p$ referring to the column numbers and the entries $n$ being the row elements. +!bt +\[ +\bm{X}=\begin{bmatrix} +x_{0,0} & x_{0,1} & x_{0,2}& \dots & \dots x_{0,p-1}\\ +x_{1,0} & x_{1,1} & x_{1,2}& \dots & \dots x_{1,p-1}\\ +x_{2,0} & x_{2,1} & x_{2,2}& \dots & \dots x_{2,p-1}\\ +\dots & \dots & \dots & \dots \dots & \dots \\ +x_{n-2,0} & x_{n-2,1} & x_{n-2,2}& \dots & \dots x_{n-2,p-1}\\ +x_{n-1,0} & x_{n-1,1} & x_{n-1,2}& \dots & \dots x_{n-1,p-1}\\ +\end{bmatrix}, +\] +!et +* Center the data by subtracting the mean value for each column. This leads to a new matrix $\bm{X}\rightarrow \overline{\bm{X}}$. +* Compute then the covariance/correlation matrix $\mathbb{E}[\overline{\bm{X}}\overline{\bm{X}}^T]. +* Find the eigenpairs of $\bm{C}$ with eigenvalues $[\lambda_0,\lambda_1,\dots,\lambda_{p-1}]$ and eigenvectors $[\bm{s}_0,\bm{s}_1,\dots,\bm{s}_{p-1}]$. +* Order the eigenvalue (and the eigenvectors accordingly) in order of decreasing eigenvalues. +* Keep only those $l$ eigenvalues larger than a selected threshold value, discarding thus $p-l$ features since we expect small variations in the data here. + +After this we ask ourselves how do we prove the link between the maximum variance and the feature reduction. + !split ===== Classical PCA Theorem ===== diff --git a/doc/src/DimRed/mlpfranke.py b/doc/src/DimRed/mlpfranke.py new file mode 100644 index 000000000..639e605ef --- /dev/null +++ b/doc/src/DimRed/mlpfranke.py @@ -0,0 +1,68 @@ +# Common imports +import numpy as np +from sklearn.neural_network import MLPRegressor +from sklearn.metrics import accuracy_score +import seaborn as sns +import matplotlib.pyplot as plt + +def FrankeFunction(x,y): + term1 = 0.75*np.exp(-(0.25*(9*x-2)**2) - 0.25*((9*y-2)**2)) + term2 = 0.75*np.exp(-((9*x+1)**2)/49.0 - 0.1*(9*y+1)) + term3 = 0.5*np.exp(-(9*x-7)**2/4.0 - 0.25*((9*y-3)**2)) + term4 = -0.2*np.exp(-(9*x-4)**2 - (9*y-7)**2) + return term1 + term2 + term3 + term4 + + +def create_X(x, y, n ): + if len(x.shape) > 1: + x = np.ravel(x) + y = np.ravel(y) + + N = len(x) + l = int((n+1)*(n+2)/2) # Number of elements in beta + X = np.ones((N,l)) + + for i in range(1,n+1): + q = int((i)*(i+1)/2) + for k in range(i+1): + X[:,q+k] = (x**(i-k))*(y**k) + + return X + + +# Making meshgrid of datapoints and compute Franke's function +n = 4 +N = 100 +x = np.sort(np.random.uniform(0, 1, N)) +y = np.sort(np.random.uniform(0, 1, N)) +z = FrankeFunction(x, y) +X = create_X(x, y, n=n) + +# only training data, no advanced splitting +X_train = X +Y_train = z +# only one simple layer with 100 neurons +n_hidden_neurons = 100 +epochs = 100 +# store models for later use +eta_vals = np.logspace(-5, 1, 7) +lmbd_vals = np.logspace(-5, 1, 7) +# store the models for later use +DNN_scikit = np.zeros((len(eta_vals), len(lmbd_vals)), dtype=object) +train_accuracy = np.zeros((len(eta_vals), len(lmbd_vals))) +sns.set() +for i, eta in enumerate(eta_vals): + for j, lmbd in enumerate(lmbd_vals): + dnn = MLPRegressor(hidden_layer_sizes=(n_hidden_neurons), activation='logistic', + alpha=lmbd, learning_rate_init=eta, max_iter=epochs) + dnn.fit(X_train, Y_train) + DNN_scikit[i][j] = dnn + train_accuracy[i][j] = dnn.score(X_train, Y_train) + +fig, ax = plt.subplots(figsize = (10, 10)) +sns.heatmap(train_accuracy, annot=True, ax=ax, cmap="viridis") +ax.set_title("Training Accuracy") +ax.set_ylabel("$\eta$") +ax.set_xlabel("$\lambda$") +plt.show() +