komodoml.base¶
Base module for KomodoML.
- class komodoml.base.BaseModel(model)¶
Bases:
objectGeneric ML model wrapper that provides a consistent interface for all models implemented.
- fit(X, y=None, resampling: ResamplingStrategy = None, **kwargs)¶
Fit the model to the data, optionally using a resampling strategy.
- Parameters:
X (array-like, shape (n_samples, n_features)) – Training data.
y (array-like, shape (n_samples,) or (n_samples, n_outputs), default=None) – Target values.
resampling (ResamplingStrategy, default=None) – Resampling strategy to use.
**kwargs (additional keyword arguments) – Additional arguments passed to the model’s fit method.
- predict(X, **kwargs)¶
Predict using the model.
- Parameters:
X (array-like, shape (n_samples, n_features)) – Samples.
**kwargs (additional keyword arguments) – Additional arguments passed to the model’s predict method.
- score(X, y=None, **kwargs)¶
- class komodoml.base.Wrapper(name, bases, namespace, **kwargs)¶
Bases:
typeMetaclass to wrap methods from an underlying model class into the wrapper class. The underlying model class should be specified in the wrapped_cls attribute.