'Performs the M-step of EM algorithm.
Parameters
stats : dict
Sufficient statistics updated from all available samples.'

def _do_mstep(self, stats):

    if ('s' in self.params):
        startprob_ = ((self.startprob_prior - 1.0) + stats['start'])
        self.startprob_ = np.where((self.startprob_ == 0.0), self.startprob_, startprob_)
        normalize(self.startprob_)
    if ('t' in self.params):
        transmat_ = ((self.transmat_prior - 1.0) + stats['trans'])
        self.transmat_ = np.where((self.transmat_ == 0.0), self.transmat_, transmat_)
        normalize(self.transmat_, axis=1)
