Skip to content

Commit

Permalink
[Doc] various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Oct 25, 2023
1 parent 309263b commit 7aaefd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions python/treelite/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def load(
cls, filename: str, model_format: str, allow_unknown_field: bool = False
) -> Model:
"""
Deprecated. Please use \ref ~treelite.frontend.load_xgboost_model instead.
Load a tree ensemble model from a file
Deprecated. Please use :py:meth:`~treelite.frontend.load_xgboost_model` instead.
Load a tree ensemble model from a file.
Parameters
----------
Expand Down Expand Up @@ -157,8 +157,8 @@ def deprecation_warning(alt: str) -> None:
@classmethod
def from_xgboost(cls, booster: Any) -> Model:
"""
Deprecated. Please use \ref ~treelite.frontend.from_xgboost instead.
Load a tree ensemble model from an XGBoost Booster object
Deprecated. Please use :py:meth:`~treelite.frontend.from_xgboost` instead.
Load a tree ensemble model from an XGBoost Booster object.
Parameters
----------
Expand Down Expand Up @@ -187,8 +187,8 @@ def from_xgboost_json(
allow_unknown_field: bool = False,
) -> Model:
"""
Deprecated. Please use \ref ~treelite.frontend.from_xgboost_json instead.
Load a tree ensemble model from a string containing XGBoost JSON
Deprecated. Please use :py:meth:`~treelite.frontend.from_xgboost_json` instead.
Load a tree ensemble model from a string containing XGBoost JSON.
Parameters
----------
Expand Down Expand Up @@ -218,8 +218,8 @@ def from_xgboost_json(
@classmethod
def from_lightgbm(cls, booster):
"""
Deprecated. Please use \ref ~treelite.frontend.from_lightgbm instead.
Load a tree ensemble model from a LightGBM Booster object
Deprecated. Please use :py:meth:`~treelite.frontend.from_lightgbm` instead.
Load a tree ensemble model from a LightGBM Booster object.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion python/treelite/sklearn/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ctypes

import numpy as np
from sklearn.dummy import DummyClassifier, DummyRegressor

from ..core import _LIB, TreeliteError, _check_call
from ..frontend import Model
Expand Down Expand Up @@ -109,6 +108,7 @@ def import_model(sklearn_model):
test nodes have numerical test conditions.
"""
try:
from sklearn.dummy import DummyClassifier, DummyRegressor
from sklearn.ensemble import ExtraTreesClassifier as ExtraTreesC
from sklearn.ensemble import ExtraTreesRegressor as ExtraTreesR
from sklearn.ensemble import GradientBoostingClassifier as GradientBoostingC
Expand Down

0 comments on commit 7aaefd5

Please sign in to comment.