Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean imports #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions mlfromscratch/unsupervised_learning/gaussian_mixture_model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
from __future__ import division, print_function
import numpy as np
import math
from sklearn import datasets
import numpy as np

from mlfromscratch.utils import normalize, euclidean_distance, calculate_covariance_matrix
from mlfromscratch.utils import Plot


class GaussianMixtureModel():
"""A probabilistic clustering method for determining groupings among data samples.
Expand Down Expand Up @@ -37,7 +32,7 @@ def _init_random_gaussians(self, X):
for i in range(self.k):
params = {}
params["mean"] = X[np.random.choice(range(n_samples))]
params["cov"] = calculate_covariance_matrix(X)
params["cov"] = np.cov(X, rowvar=False)
self.parameters.append(params)

def multivariate_gaussian(self, X, params):
Expand Down