<jupyter_start><jupyter_text>Eigen Decomposition in `numpy`A demonstration of:  $\textbf{X}v = \lambda v$  for the first principal eigenvalue of the example in lecture on Dimension Reduction.<jupyter_code>import numpy as np
X = np.array([[1, 0.5, 0.333, 0.25],
              [0.5, 1, 0.667, 0.5],
              [0.333, 0.667,1, 0.75],
              [0.25, 0.5, 0.75, 1]
             ])
eVal, eVec = np.linalg.eig(X)<jupyter_output><empty_output><jupyter_text>The eigenvalues<jupyter_code>eVal<jupyter_output><empty_output><jupyter_text>The eigenvectors (in columns)<jupyter_code>eVec
vec1 = eVec[:,0]
val1 = eVal[0]
val1, vec1<jupyter_output><empty_output><jupyter_text>The matrix multiplied by the first eigenvalue.<jupyter_code>X.dot(vec1)<jupyter_output><empty_output><jupyter_text>The first eigenvalue multiplied by the first eigenvector.<jupyter_code>val1 * vec1<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.054626532887402456, 'mean_word_length': 4.869281045751634, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '267601', 'license': 'Apache-2.0', 'n_tokens_mistral': 380, 'n_tokens_neox': 343, 'n_words': 68, 'path': 'Complete Modules/ML labs/lab 9 - Dimention Reduction/09 Eigen.ipynb', 'repo_name': 'Maks-Drzezdzon/Working-With-Data-L-O', 'size': '897'}