Save and Load¶
Saving and loading models is desired as the learning proces of a model for distfit
can take up to hours.
In order to accomplish this, we created two functions: function distfit.save()
and function distfit.load()
Below we illustrate how to save and load models.
Saving¶
Saving a learned model can be done using the function distfit.save()
:
import distfit
# Load example data
X,y_true = distfit.load_example()
# Learn model
model = distfit.fit_transform(X, y_true, pos_label='bad')
Save model
status = distfit.save(model, 'learned_model_v1')
Loading¶
Loading a learned model can be done using the function distfit.load()
:
import distfit
# Load model
model = distfit.load(model, 'learned_model_v1')