Compute the responsibilities of a Gaussian mixture model for one point x: the posterior probability that each component generated it. weights are the mixture weights, means the component means and covs the covariance matrices.
Implement solve(x, weights, means, covs).
Returns. Return a NumPy vector of length K that sums to 1.
Example 1
Input:
solve([0.0], [0.5, 0.5], [[0.0], [4.0]], [[[1.0]], [[1.0]]])
Output:
[0.999665, 0.000335]
Example 2
Input:
solve([1.0], [0.8, 0.2], [[0.0], [2.0]], [[[1.0]], [[1.0]]])
Output:
[0.8, 0.2]
No results yet
Run your code to check it against the examples, or submit to run every test.