def save(self, filename): '''Save the model to file in YAML format.''' with open(filename, 'w') as fout: dump(self, fout, Dumper=Dumper)