fatf.utils.models.models
.Model¶
-
class
fatf.utils.models.models.
Model
[source]¶ An abstract class used to implement predictive models.
This abstract class requires
fit
andpredict
methods and defines an optionalpredict_proba
method.This is a scikit-learn-inspired model specification and it is being relied on through out this package.
- Raises
- NotImplementedError
Any of the required methods –
fit
orpredict
– is not implemented.
Methods
fit
(X, y)Fits this predictive model.
predict
(X)Predicts labels of new data points using this model.
Predicts probabilities of labels for new data points using this model.
-
fit
(X: numpy.ndarray, y: numpy.ndarray) → None[source]¶ Fits this predictive model.
- Parameters
- Xnumpy.ndarray
A 2-dimensional numpy data array used to fit the model.
- ynumpy.ndarray
A 1-dimensional numpy labels array used to fit the model.
-
predict
(X: numpy.ndarray) → None[source]¶ Predicts labels of new data points using this model.
- Parameters
- Xnumpy.ndarray
A 2-dimensional numpy data array for which labels are predicted.
-
predict_proba
(X: numpy.ndarray) → None[source]¶ Predicts probabilities of labels for new data points using this model.
- Parameters
- Xnumpy.ndarray
A 2-dimensional numpy data array for which labels probabilities are predicted.
- Raises
- NotImplementedError
By default this method is not required, hence it raises a
NotImplementedError
.