def __str__(self): """ Returns a human-readable string representation of the HMM """ output = 'Hidden Markov model\n' output += '-------------------\n' output += 'nstates: %d\n' % self._nstates output += 'Tij:\n' output += str(self._Tij) + '\n' output += 'Pi:\n' output += str(self._Pi) + '\n' output += 'output model:\n' from bhmm.output_models import OutputModel if issubclass(self.__class__, OutputModel): output += str(OutputModel.__str__(self)) else: output += str(self.output_model) output += '\n' return output
def __str__(self): """ Returns a human-readable string representation of the HMM """ output = "Hidden Markov model\n" output += "-------------------\n" output += "nstates: %d\n" % self._nstates output += "Tij:\n" output += str(self._Tij) + "\n" output += "Pi:\n" output += str(self._Pi) + "\n" output += "output model:\n" from bhmm.output_models import OutputModel if issubclass(self.__class__, OutputModel): output += str(OutputModel.__str__(self)) else: output += str(self.output_model) output += "\n" return output