MCPcopy Create free account
hub / github.com/rushter/MLAlgorithms / _predict

Method _predict

mla/gaussian_mixture.py:117–124  ·  view source on GitHub ↗

Get the assignments for X with GMM clusters.

(self, X)

Source from the content-addressed store, hash-verified

115 return False
116
117 def _predict(self, X):
118 """Get the assignments for X with GMM clusters."""
119 if not X.shape:
120 return self.assignments
121 likelihoods = self._get_likelihood(X)
122 weighted_likelihoods = self._get_weighted_likelihood(likelihoods)
123 assignments = weighted_likelihoods.argmax(axis=1)
124 return assignments
125
126 def _get_likelihood(self, data):
127 n_data = data.shape[0]

Callers

nothing calls this directly

Calls 2

_get_likelihoodMethod · 0.95

Tested by

no test coverage detected