I'm having a hard time with contour plotting. The contour lines are going crazy in my plot, and I'm not sure why. You can see some of the data points in the background.
print positive_train_data.shape
#returns (1131,2)
def GaMM():
GaussMM = GMM(n_components=3)
GaussMM.fit(positive_train_data)
X, Y = np.meshgrid(positive_train_data[:, 0], positive_train_data[:, 1])
XX = np.array([X.ravel(), Y.ravel()]).T
Z = -GaussMM.score(XX)
Z = Z.reshape(X.shape)
CS = plt.contour(X, Y, Z)
CB = plt.colorbar(CS, shrink=0.8, extend='both')
plt.scatter(positive_train_data[:, 0], positive_train_data[:, 1])
GaMM()