mml-book / mml-book.github.io

Companion webpage to the book "Mathematics For Machine Learning"
13.11k stars 2.42k forks source link

the notebook(Principal Component Analysis (PCA)) can not run #744

Open younggggger opened 1 year ago

younggggger commented 1 year ago

the notebook can not run showing as below:


KeyError Traceback (most recent call last) /usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3628 try: -> 3629 return self._engine.get_loc(casted_key) 3630 except KeyError as err:

4 frames pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 0

The above exception was the direct cause of the following exception:

KeyError Traceback (most recent call last) /usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3629 return self._engine.get_loc(casted_key) 3630 except KeyError as err: -> 3631 raise KeyError(key) from err 3632 except TypeError: 3633 # If we have a listlike key, _check_indexing_error will raise

KeyError: 0 <Figure size 288x288 with 0 Axes>

Principal Component Analysis (PCA)

by Marc Deisenroth and Yicheng Luo

We will implement the PCA algorithm using the projection perspective. We will first implement PCA, then apply it to the MNIST digit dataset.