Skip to content

Commit

Permalink
DOC: Init Xgboost Doc (#525)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Hank0626 and mergify[bot] committed Jun 20, 2023
1 parent 20d9bd0 commit 8e96864
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 14 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ As long as you know how to use numpy, pandas and so forth, you would probably kn

All Xorbits APIs implemented or planned include:

| API | Implemented version or plan |
|--------------------------------------------------------------------------------|-----------------------------|
| [xorbits.pandas](https://doc.xorbits.io/en/latest/reference/pandas/index.html) | v0.1.0 |
| [xorbits.numpy](https://doc.xorbits.io/en/latest/reference/numpy/index.html) | v0.1.0 |
| xorbits.sklearn | Planned in the near future |
| xorbits.xgboost | Planned in the near future |
| xorbits.lightgbm | Planned in the near future |
| xorbits.xarray | Planned in the future |
| xorbits.scipy | Planned in the future |
| xorbits.statsmodels | Planned in the future |
| API | Implemented version or plan |
|---------------------------------------------------------------------------------|-----------------------------|
| [xorbits.pandas](https://doc.xorbits.io/en/latest/reference/pandas/index.html) | v0.1.0 |
| [xorbits.numpy](https://doc.xorbits.io/en/latest/reference/numpy/index.html) | v0.1.0 |
| [xorbits.xgboost](https://doc.xorbits.io/en/latest/reference/xgboost/index.html)| v0.4.0 |
| xorbits.lightgbm | Planned in the near future |
| xorbits.sklearn | Planned in the near future |
| xorbits.xarray | Planned in the future |
| xorbits.scipy | Planned in the future |
| xorbits.statsmodels | Planned in the future |

## Lightning fast speed
Xorbits is the fastest compared to other popular frameworks according to our benchmark tests.
Expand Down
3 changes: 2 additions & 1 deletion doc/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ API Reference

xorbits/index
pandas/index
numpy/index
numpy/index
xgboost/index
12 changes: 12 additions & 0 deletions doc/source/reference/xgboost/core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _api.core_data_strucutre:

===================
Core Data Structure
===================
.. currentmodule:: xorbits.xgboost


.. autosummary::
:toctree: generated/

DMatrix
12 changes: 12 additions & 0 deletions doc/source/reference/xgboost/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _xgboost_api:

===========
XGBoost API
===========

.. toctree::
:maxdepth: 2

sklearn
learning_api
core
13 changes: 13 additions & 0 deletions doc/source/reference/xgboost/learning_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _api.learning_api:

============
Learning API
============
.. currentmodule:: xorbits.xgboost


.. autosummary::
:toctree: generated/

train
predict
65 changes: 65 additions & 0 deletions doc/source/reference/xgboost/sklearn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. _api.sklearn:

================
Scikit-Learn API
================

XGBRegressor
============
.. currentmodule:: xorbits.xgboost

Constructor
~~~~~~~~~~~
.. autosummary::
:toctree: generated/

XGBRegressor

Attributes
~~~~~~~~~~

.. autosummary::
:toctree: generated/

XGBRegressor.apply
XGBRegressor.evals_result
XGBRegressor.fit
XGBRegressor.get_booster
XGBRegressor.get_num_boosting_rounds
XGBRegressor.get_params
XGBRegressor.get_xgb_params
XGBRegressor.load_model
XGBRegressor.predict
XGBRegressor.save_model
XGBRegressor.set_params

XGBClassifier
=============
.. currentmodule:: xorbits.xgboost

Constructor
~~~~~~~~~~~
.. autosummary::
:toctree: generated/

XGBClassifier

Attributes
~~~~~~~~~~

.. autosummary::
:toctree: generated/

XGBClassifier.apply
XGBClassifier.evals_result
XGBClassifier.fit
XGBClassifier.get_booster
XGBClassifier.get_num_boosting_rounds
XGBClassifier.get_params
XGBClassifier.get_xgb_params
XGBClassifier.load_model
XGBClassifier.predict
XGBClassifier.predict_proba
XGBClassifier.save_model
XGBClassifier.score
XGBClassifier.set_params
2 changes: 2 additions & 0 deletions python/xorbits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ def _install():
from .numpy import _install as _install_numpy
from .pandas import _install as _install_pandas
from .web import _install as _install_web
from .xgboost import _install as _install_xgboost

_install_pandas()
_install_numpy()
_install_web()
_install_xgboost()


_install()
Expand Down
4 changes: 4 additions & 0 deletions python/xorbits/xgboost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
from ..core.utils.fallback import unimplemented_func


def _install():
"""Nothing required for installing xgboost."""


def __dir__():
from .mars_adapters import MARS_XGBOOST_CALLABLES

Expand Down
6 changes: 3 additions & 3 deletions python/xorbits/xgboost/mars_adapters/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@

class BaseXGB:
def __init__(self, *args, **kwargs):
self.mars_instance = self.mars_cls(*to_mars(args), **to_mars(kwargs))
self.mars_instance = self._mars_cls(*to_mars(args), **to_mars(kwargs))

class XGBClassifier(BaseXGB):
mars_cls = MarsXGBClassifier
_mars_cls = MarsXGBClassifier

class XGBRegressor(BaseXGB):
mars_cls = MarsXGBRegressor
_mars_cls = MarsXGBRegressor

xgboost_class_mappings: Dict = {
XGBClassifier: MarsXGBClassifier,
Expand Down

0 comments on commit 8e96864

Please sign in to comment.