Question: Mixture model for matrix completion from typing import Tuple import numpy as np from scipy.special import logsumexp from common import GaussianMixture def
Mixture model for matrix completion"""
from typing import Tuple
import numpy as np
from scipy.special import logsumexp
from common import GaussianMixture
def estepX: npndarray, mixture: GaussianMixture Tuplenpndarray, float:
Estep: Softly assigns each datapoint to a gaussian component
Args:
X: n d array holding the data, with incomplete entries set to
mixture: the current gaussian mixture
Returns:
npndarray: n K array holding the soft counts
for all components for all examples
float: loglikelihood of the assignment
raise NotImplementedError
def mstepX: npndarray, post: npndarray, mixture: GaussianMixture,
minvariance: float GaussianMixture:
Mstep: Updates the gaussian mixture by maximizing the loglikelihood
of the weighted dataset
Args:
X: n d array holding the data, with incomplete entries set to
post: n K array holding the soft counts
for all components for all examples
mixture: the current gaussian mixture
minvariance: the minimum variance for each gaussian
Returns:
GaussianMixture: the new gaussian mixture
raise NotImplementedError
def runX: npndarray, mixture: GaussianMixture,
post: npndarray TupleGaussianMixture npndarray, float:
Runs the mixture model
Args:
X: n d array holding the data
post: n K array holding the soft counts
for all components for all examples
Returns:
GaussianMixture: the new gaussian mixture
npndarray: n K array holding the soft counts
for all components for all examples
float: loglikelihood of the current assignment
raise NotImplementedError
def fillmatrixX: npndarray, mixture: GaussianMixture npndarray:
Fills an incomplete matrix according to a mixture model
Args:
X: n d array of incomplete data incomplete entries
mixture: a mixture of gaussians
Returns
npndarray: a n d array with completed data
raise NotImplementedError
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
