|
| 1 | +from ..base_models.tangos import Tangos |
| 2 | +from ..configs.tangos_config import DefaultTangosConfig |
| 3 | +from ..utils.docstring_generator import generate_docstring |
| 4 | +from .utils.sklearn_base_classifier import SklearnBaseClassifier |
| 5 | +from .utils.sklearn_base_lss import SklearnBaseLSS |
| 6 | +from .utils.sklearn_base_regressor import SklearnBaseRegressor |
| 7 | + |
| 8 | + |
| 9 | +class TangosRegressor(SklearnBaseRegressor): |
| 10 | + __doc__ = generate_docstring( |
| 11 | + DefaultTangosConfig, |
| 12 | + model_description=""" |
| 13 | + Tangos regressor. This class extends the SklearnBaseRegressor class and uses the Tangos model |
| 14 | + with the default Tangos configuration. |
| 15 | + """, |
| 16 | + examples=""" |
| 17 | + >>> from mambular.models import TangosRegressor |
| 18 | + >>> model = TangosRegressor(d_model=64, n_layers=8) |
| 19 | + >>> model.fit(X_train, y_train) |
| 20 | + >>> preds = model.predict(X_test) |
| 21 | + >>> model.evaluate(X_test, y_test) |
| 22 | + """, |
| 23 | + ) |
| 24 | + |
| 25 | + def __init__(self, **kwargs): |
| 26 | + super().__init__(model=Tangos, config=DefaultTangosConfig, **kwargs) |
| 27 | + |
| 28 | + |
| 29 | +class TangosClassifier(SklearnBaseClassifier): |
| 30 | + __doc__ = generate_docstring( |
| 31 | + DefaultTangosConfig, |
| 32 | + model_description=""" |
| 33 | + Tangos classifier This class extends the SklearnBaseClassifier class and uses the Tangos model |
| 34 | + with the default Tangos configuration. |
| 35 | + """, |
| 36 | + examples=""" |
| 37 | + >>> from mambular.models import TangosClassifier |
| 38 | + >>> model = TangosClassifier(d_model=64, n_layers=8) |
| 39 | + >>> model.fit(X_train, y_train) |
| 40 | + >>> preds = model.predict(X_test) |
| 41 | + >>> model.evaluate(X_test, y_test) |
| 42 | + """, |
| 43 | + ) |
| 44 | + |
| 45 | + def __init__(self, **kwargs): |
| 46 | + super().__init__(model=Tangos, config=DefaultTangosConfig, **kwargs) |
| 47 | + |
| 48 | + |
| 49 | +class TangosLSS(SklearnBaseLSS): |
| 50 | + __doc__ = generate_docstring( |
| 51 | + DefaultTangosConfig, |
| 52 | + model_description=""" |
| 53 | + Tangos for distributional regression. This class extends the SklearnBaseLSS class and uses the Tangos model |
| 54 | + with the default Tangos configuration. |
| 55 | + """, |
| 56 | + examples=""" |
| 57 | + >>> from mambular.models import TangosLSS |
| 58 | + >>> model = TangosLSS(d_model=64, n_layers=8) |
| 59 | + >>> model.fit(X_train, y_train, family='normal') |
| 60 | + >>> preds = model.predict(X_test) |
| 61 | + >>> model.evaluate(X_test, y_test) |
| 62 | + """, |
| 63 | + ) |
| 64 | + |
| 65 | + def __init__(self, **kwargs): |
| 66 | + super().__init__(model=Tangos, config=DefaultTangosConfig, **kwargs) |
0 commit comments