1

According to this task:

Principal Component Analysis (PCA) in Python

I included this line

import from matplotlib.mlab import PCA

but I get the error message:

cannot import name 'PCA' from 'matplotlib.mlab'

I'm using Python3.7 and I have no idea how I can use the PCA function from matlab. Is the new version of matplotlib depricated or is PCA included to another library?

Ramón Wilhelm
  • 967
  • 2
  • 18
  • 39

1 Answers1

6

I really don't know if it is too late to reply now. But I will just place it here anyways.

import numpy as np
from sklearn.decomposition import PCA
Flair
  • 2,609
  • 1
  • 29
  • 41
pachinchin
  • 61
  • 1
  • 2