[xgb] update docs (#12549)

This commit is contained in:
Kai Fricke
2020-12-02 08:17:23 +01:00
committed by GitHub
parent e428134137
commit 63b85df828
4 changed files with 11 additions and 8 deletions
+4 -2
View File
@@ -4,13 +4,15 @@ logger = logging.getLogger(__name__)
train = None
predict = None
RayParams = None
RayDMatrix = None
RayFileType = None
try:
from xgboost_ray import train, predict, RayDMatrix, RayFileType
from xgboost_ray import train, predict, RayParams, RayDMatrix, RayFileType
except ImportError:
logger.info(
"xgboost_ray is not installed. Please run "
"`pip install git+https://github.com/ray-project/xgboost_ray`.")
__all__ = ["train", "predict", "RayDMatrix", "RayFileType"]
__all__ = ["train", "predict", "RayParams", "RayDMatrix", "RayFileType"]
+2 -3
View File
@@ -1,7 +1,7 @@
from sklearn import datasets
from sklearn.model_selection import train_test_split
from ray.util.xgboost import RayDMatrix, train
from ray.util.xgboost import RayDMatrix, RayParams, train
# __xgboost_begin__
@@ -31,8 +31,7 @@ def main():
train_set,
evals=[(test_set, "eval")],
evals_result=evals_result,
max_actor_restarts=1,
checkpoint_path="/tmp/checkpoint/",
ray_params=RayParams(max_actor_restarts=1),
verbose_eval=False)
bst.save_model("simple.xgb")
+3 -3
View File
@@ -1,7 +1,7 @@
from sklearn import datasets
from sklearn.model_selection import train_test_split
from ray.util.xgboost import RayDMatrix, train
from ray.util.xgboost import RayDMatrix, RayParams, train
# __train_begin__
num_cpus_per_actor = 1
@@ -25,8 +25,8 @@ def train_model(config):
evals=[(test_set, "eval")],
evals_result=evals_result,
verbose_eval=False,
num_actors=num_actors,
cpus_per_actor=num_cpus_per_actor)
ray_params=RayParams(
num_actors=num_actors, cpus_per_actor=num_cpus_per_actor))
bst.save_model("model.xgb")