PacktPublishing/Artificial-Intelligence-with-Python

Ch 4: Building a classifier based on Gaussian Mixture Models

Lauro199471 opened this issue · 2 comments

# Draw boundaries 
plt.figure() 
colors = 'bgr' 
for i, color in enumerate(colors): 
    # Extract eigenvalues and eigenvectors 
    eigenvalues, eigenvectors = np.linalg.eigh( 
            classifier._get_covars()[i][:2, :2]) 

Output

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-34-c243fd25d6f3> in <module>
      5     # Extract eigenvalues and eigenvectors
      6     eigenvalues, eigenvectors = np.linalg.eigh( 
----> 7             classifier._get_covars()[i][:2, :2]) 

AttributeError: 'GaussianMixture' object has no attribute '_get_covars'

<Figure size 432x288 with 0 Axes>

Fix:

classifier.covariances_[i][:2, :2])

thank you man i want children from you