def dump(self, outfile):
'''
Serialize the model for this learner and write it to a file.
Serialized models can be loaded back in with `load`.
By default, pickle the entire object. This may not be very efficient
or reliable for long-term storage; consider overriding this (and `load`)
to serialize only the necessary parameters. Alternatively, you can
define __getstate__ and __setstate__ for subclasses to influence how
the model is pickled (see https://docs.python.org/2/library/pickle.html).
:param file outfile: A file-like object where the serialized model will
be written.
'''
pickle.dump(self, outfile)
python类html()的实例源码
def dump(self, outfile):
'''
Serialize the model for this learner and write it to a file.
Serialized models can be loaded back in with `load`.
By default, pickle the entire object. This may not be very efficient
or reliable for long-term storage; consider overriding this (and `load`)
to serialize only the necessary parameters. Alternatively, you can
define __getstate__ and __setstate__ for subclasses to influence how
the model is pickled (see https://docs.python.org/2/library/pickle.html).
:param file outfile: A file-like object where the serialized model will
be written.
'''
pickle.dump(self, outfile)