def test_calc_local_params(self):
    # calculate the soft assignment probabilities for all data items
    # make sure that the items generated by each component
    #  are (statistically) associated with that component
    LP = self.obsM.calc_local_params(self.Data)
    lpr = LP['E_log_soft_ev']
    maxIDs = np.argmax(lpr, axis=1)
    for k in range(self.obsM.K):
      currange = range(k*self.C, (k+1)*self.C)
      matchMask = maxIDs[currange]==k
      nMatch = np.sum(matchMask)
      assert nMatch > 0.8*self.C
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/tests/obsmodel/TestZMGaussObsModel.py/TestZMGaussObsModelEM.test_calc_local_params/original