def save(self, filename="temp.pkl"):
    """
    Save TM in the filename specified above
    """
    output = open(filename, 'wb')
    cPickle.dump(self.tm, output, protocol=cPickle.HIGHEST_PROTOCOL)
Save TM in the filename specified above