register_model¶
- register_model(model_class)[source]¶
Register new model to the collection.
Example:
import perturb_lib as plib import numpy as np @plib.register_model class CoolModel(plib.ModelMixin): def fit(self, traindata: plib.PlibData, valdata: plib.PlibData | None = None): pass def predict(self, data_x: plib.PlibData): return np.zeros(len(data_x))
- Parameters:
model_class (
Type
[ModelMixin
]) – model class to register- Raises:
ValueError – If model with the same name exists already.