diff --git a/README.md b/README.md index 4f11dfc22..f03685681 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst index d02624acd..c8646966a 100644 --- a/doc/source/reference/index.rst +++ b/doc/source/reference/index.rst @@ -9,4 +9,5 @@ API Reference xorbits/index pandas/index - numpy/index \ No newline at end of file + numpy/index + xgboost/index \ No newline at end of file diff --git a/doc/source/reference/xgboost/core.rst b/doc/source/reference/xgboost/core.rst new file mode 100644 index 000000000..c453e91c1 --- /dev/null +++ b/doc/source/reference/xgboost/core.rst @@ -0,0 +1,12 @@ +.. _api.core_data_strucutre: + +=================== +Core Data Structure +=================== +.. currentmodule:: xorbits.xgboost + + +.. autosummary:: + :toctree: generated/ + + DMatrix diff --git a/doc/source/reference/xgboost/index.rst b/doc/source/reference/xgboost/index.rst new file mode 100644 index 000000000..6c0703a11 --- /dev/null +++ b/doc/source/reference/xgboost/index.rst @@ -0,0 +1,12 @@ +.. _xgboost_api: + +=========== +XGBoost API +=========== + +.. toctree:: + :maxdepth: 2 + + sklearn + learning_api + core \ No newline at end of file diff --git a/doc/source/reference/xgboost/learning_api.rst b/doc/source/reference/xgboost/learning_api.rst new file mode 100644 index 000000000..966e75d28 --- /dev/null +++ b/doc/source/reference/xgboost/learning_api.rst @@ -0,0 +1,13 @@ +.. _api.learning_api: + +============ +Learning API +============ +.. currentmodule:: xorbits.xgboost + + +.. autosummary:: + :toctree: generated/ + + train + predict diff --git a/doc/source/reference/xgboost/sklearn.rst b/doc/source/reference/xgboost/sklearn.rst new file mode 100644 index 000000000..12ae679d5 --- /dev/null +++ b/doc/source/reference/xgboost/sklearn.rst @@ -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 \ No newline at end of file diff --git a/python/xorbits/__init__.py b/python/xorbits/__init__.py index fe4f0621a..9008a7a35 100644 --- a/python/xorbits/__init__.py +++ b/python/xorbits/__init__.py @@ -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() diff --git a/python/xorbits/xgboost/__init__.py b/python/xorbits/xgboost/__init__.py index e63ba9d7c..c6886da87 100644 --- a/python/xorbits/xgboost/__init__.py +++ b/python/xorbits/xgboost/__init__.py @@ -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 diff --git a/python/xorbits/xgboost/mars_adapters/core.py b/python/xorbits/xgboost/mars_adapters/core.py index 503d79ed2..b613f1061 100644 --- a/python/xorbits/xgboost/mars_adapters/core.py +++ b/python/xorbits/xgboost/mars_adapters/core.py @@ -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,