from catboost import CatBoostRegressor, CatBoostClassifier
from .fanova_base import FANOVATreeInterpretBase
from ..sklearn import MoSKLearnRegressor, MoSKLearnClassifier
[docs]
class MoCatBoostRegressor(MoSKLearnRegressor, FANOVATreeInterpretBase):
"""
A lightweight wrapper of `catboost.CatBoostRegressor <https://catboost.ai/docs/en/concepts/python-reference_catboostregressor>`_.
Parameters
----------
name : str, default=None
Identifier for the model instance.
*args
Variable length argument list passed to the underlying CatBoostRegressor model.
**kwargs
Arbitrary keyword arguments passed to the underlying CatBoostRegressor model.
"""
def __init__(self, name: str = None, *args, **kwargs):
super().__init__(name=name, estimator=CatBoostRegressor(*args, **kwargs))
[docs]
def get_params(self, deep=True):
"""
Get parameters for this estimator.
Parameters
----------
deep : bool, default=True
If True, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns
-------
params : dict
Parameter names mapped to their values.
"""
return self.estimator.get_params(deep=deep)
[docs]
class MoCatBoostClassifier(MoSKLearnClassifier, FANOVATreeInterpretBase):
"""
A lightweight wrapper of `catboost.CatBoostClassifier <https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier>`_.
Parameters
----------
name : str, default=None
Identifier for the model instance.
*args
Variable length argument list passed to the underlying CatBoostClassifier model.
**kwargs
Arbitrary keyword arguments passed to the underlying CatBoostClassifier model.
"""
def __init__(self, name: str = None, *args, **kwargs):
super().__init__(name=name, estimator=CatBoostClassifier(*args, **kwargs))
[docs]
def get_params(self, deep=True):
"""
Get parameters for this estimator.
Parameters
----------
deep : bool, default=True
If True, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns
-------
params : dict
Parameter names mapped to their values.
"""
return self.estimator.get_params(deep=deep)