Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ Functions
register_model
reset_model_register

Julearn custom models
---------------------

This is a list of models implemented by Julearn that are not simple wrappers
around existing models in other libraries but rather variants of existing
models or novel models.

.. autosummary::
:nosignatures:
:toctree: generated/
:template: class.rst

xgb_cvearlystopping.XGBClassifierCVEarlyStopping
xgb_cvearlystopping.XGBRegressorCVEarlyStopping

Dynamic Selection (DESLib)
==========================

Expand Down
14 changes: 14 additions & 0 deletions docs/available_pipeline_steps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ Ensemble
- Y
- Y
- Y
* - ``xgb``
- XGBoost
- | :class:`~xgboost.XGBClassifier` and
| :class:`~xgboost.XGBRegressor`
- Y
- Y
- Y
Comment thread
fraimondo marked this conversation as resolved.
* - ``xgb_cvearlystopping``
- XGBoost with Cross-Validation and Early Stopping
- | :class:`~julearn.models.xgb_cvearlystopping.XGBClassifierCVEarlyStopping` and
| :class:`~julearn.models.xgb_cvearlystopping.XGBRegressorCVEarlyStopping`
- Y
- Y
- Y

Gaussian Processes
~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
None,
),
"panel": ("https://panel.holoviz.org/", None),
"xgboost": ("https://xgboost.readthedocs.io/en/stable/", None),
}

# -- sphinx.ext.extlinks configuration ---------------------------------------
Expand Down
31 changes: 31 additions & 0 deletions julearn/models/available_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@
)
from sklearn.svm import SVC, SVR


try: # pragma: no cover
from xgboost import XGBClassifier, XGBRegressor

from .xgb_cvearlystopping import (
XGBClassifierCVEarlyStopping,
XGBRegressorCVEarlyStopping,
)

_has_xgboost = True
except ImportError:
_has_xgboost = False

from ..utils import logger, raise_error, warn_with_log
from ..utils.logging import DelayedFmtMessage as __
from ..utils.typing import ModelLike
Expand Down Expand Up @@ -137,6 +150,24 @@
},
}

if _has_xgboost is True:
_available_models["xgb"] = {
"regression": XGBRegressor,
"classification": XGBClassifier,
}
_available_models["xgb_cvearlystopping"] = {
"regression": XGBRegressorCVEarlyStopping,
"classification": XGBClassifierCVEarlyStopping,
}
logger.info(
"XGBoost is available and has been added to the model registry."
)
else:
logger.info(
"XGBoost is not available and has not been added to the model "
"registry. To use XGBoost models, please install the xgboost package."
)

_available_models_reset = deepcopy(_available_models)


Expand Down
Loading
Loading