diff --git a/doc/pub/DimRed/html/._DimRed-bs007.html b/doc/pub/DimRed/html/._DimRed-bs007.html index 4005925d3..0334cf680 100644 --- a/doc/pub/DimRed/html/._DimRed-bs007.html +++ b/doc/pub/DimRed/html/._DimRed-bs007.html @@ -182,6 +182,11 @@ correlation_matrix = cancerpd# annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() + +#print eigvalues of correlation matrix +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + #split into train and test and then scale thereafter X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) diff --git a/doc/pub/DimRed/html/DimRed-reveal.html b/doc/pub/DimRed/html/DimRed-reveal.html index c8b2d434c..9fa26b993 100644 --- a/doc/pub/DimRed/html/DimRed-reveal.html +++ b/doc/pub/DimRed/html/DimRed-reveal.html @@ -459,6 +459,11 @@ correlation_matrix = cancerpd.corr().round(1 # annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() + +#print eigvalues of correlation matrix +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + #split into train and test and then scale thereafter X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) diff --git a/doc/pub/DimRed/html/DimRed-solarized.html b/doc/pub/DimRed/html/DimRed-solarized.html index bca2cf49d..6b682f7ea 100644 --- a/doc/pub/DimRed/html/DimRed-solarized.html +++ b/doc/pub/DimRed/html/DimRed-solarized.html @@ -442,6 +442,11 @@ correlation_matrix = cancerpd.corr().round(1 # annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() + +#print eigvalues of correlation matrix +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + #split into train and test and then scale thereafter X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) diff --git a/doc/pub/DimRed/html/DimRed.html b/doc/pub/DimRed/html/DimRed.html index 53607192d..5b3216924 100644 --- a/doc/pub/DimRed/html/DimRed.html +++ b/doc/pub/DimRed/html/DimRed.html @@ -447,6 +447,11 @@ correlation_matrix = cancerpd# annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() + +#print eigvalues of correlation matrix +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + #split into train and test and then scale thereafter X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) diff --git a/doc/pub/DimRed/ipynb/DimRed.ipynb b/doc/pub/DimRed/ipynb/DimRed.ipynb index 8bf7e3023..f9d4059e1 100644 --- a/doc/pub/DimRed/ipynb/DimRed.ipynb +++ b/doc/pub/DimRed/ipynb/DimRed.ipynb @@ -330,6 +330,11 @@ "# annot = True to print the values inside the square\n", "sns.heatmap(data=correlation_matrix, annot=True)\n", "plt.show()\n", + "\n", + "#print eigvalues of correlation matrix\n", + "EigValues, EigVectors = np.linalg.eig(correlation_matrix)\n", + "print(EigValues)\n", + "\n", "#split into train and test and then scale thereafter\n", "X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0)\n", "print(X_train.shape)\n", diff --git a/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz b/doc/pub/DimRed/ipynb/ipynb-DimRed-src.tar.gz index 927742fa6..2d3fa6507 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 906b00f9f..6bbfbdce6 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 26cdddd72..536a45c0f 100644 --- a/doc/src/DimRed/DimRed.do.txt +++ b/doc/src/DimRed/DimRed.do.txt @@ -287,6 +287,11 @@ correlation_matrix = cancerpd.corr().round(1) # annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() + +#print eigvalues of correlation matrix +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + #split into train and test and then scale thereafter X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) diff --git a/doc/src/DimRed/PCAcancer.py b/doc/src/DimRed/PCAcancer.py index b4983907e..c0b2f2219 100644 --- a/doc/src/DimRed/PCAcancer.py +++ b/doc/src/DimRed/PCAcancer.py @@ -8,22 +8,6 @@ import pandas as pd cancerpd = pd.DataFrame(cancer.data, columns=cancer.feature_names) -fig, axes = plt.subplots(15,2,figsize=(10,20)) -malignant = cancer.data[cancer.target == 0] -benign = cancer.data[cancer.target == 1] -ax = axes.ravel() - -for i in range(30): - _, bins = np.histogram(cancer.data[:,i], bins =50) - ax[i].hist(malignant[:,i], bins = bins, alpha = 0.5) - ax[i].hist(benign[:,i], bins = bins, alpha = 0.5) - ax[i].set_title(cancer.feature_names[i]) - ax[i].set_yticks(()) -ax[0].set_xlabel("Feature magnitude") -ax[0].set_ylabel("Frequency") -ax[0].legend(["Malignant", "Benign"], loc ="best") -fig.tight_layout() -plt.show() import seaborn as sns correlation_matrix = cancerpd.corr().round(1) @@ -31,6 +15,9 @@ correlation_matrix = cancerpd.corr().round(1) # annot = True to print the values inside the square sns.heatmap(data=correlation_matrix, annot=True) plt.show() +EigValues, EigVectors = np.linalg.eig(correlation_matrix) +print(EigValues) + X_train, X_test, y_train, y_test = train_test_split(cancer.data,cancer.target,random_state=0) print(X_train.shape) print(X_test.shape)