diff --git a/doc/python/python_api.rst b/doc/python/python_api.rst index 03b431c77d41..b27542a8becb 100644 --- a/doc/python/python_api.rst +++ b/doc/python/python_api.rst @@ -173,3 +173,13 @@ PySpark API :members: :inherited-members: :show-inheritance: + +.. autoclass:: xgboost.spark.SparkXGBRanker + :members: + :inherited-members: + :show-inheritance: + +.. autoclass:: xgboost.spark.SparkXGBRankerModel + :members: + :inherited-members: + :show-inheritance: diff --git a/doc/tutorials/spark_estimator.rst b/doc/tutorials/spark_estimator.rst index 44e7a957513b..e0acc745433d 100644 --- a/doc/tutorials/spark_estimator.rst +++ b/doc/tutorials/spark_estimator.rst @@ -43,10 +43,10 @@ in spark estimator, and some parameters are replaced with pyspark specific param such as `weight_col`, `validation_indicator_col`, `use_gpu`, for details please see `SparkXGBRegressor` doc. -The following code snippet shows how to train a spark xgboost regressor model, -first we need to prepare a training dataset as a spark dataframe contains -"label" column and "features" column(s), the "features" column(s) must be `pyspark.ml.linalg.Vector` -type or spark array type or a list of feature column names. +The following code snippet shows how to train a spark xgboost regressor model, first we +need to prepare a training dataset as a spark dataframe contains "label" column and +"features" column(s), the "features" column(s) must be ``pyspark.ml.linalg.Vector`` type +or spark array type or a list of feature column names. .. code-block:: python @@ -54,10 +54,10 @@ type or spark array type or a list of feature column names. xgb_regressor_model = xgb_regressor.fit(train_spark_dataframe) -The following code snippet shows how to predict test data using a spark xgboost regressor model, -first we need to prepare a test dataset as a spark dataframe contains -"features" and "label" column, the "features" column must be `pyspark.ml.linalg.Vector` -type or spark array type. +The following code snippet shows how to predict test data using a spark xgboost regressor +model, first we need to prepare a test dataset as a spark dataframe contains "features" +and "label" column, the "features" column must be ``pyspark.ml.linalg.Vector`` type or +spark array type. .. code-block:: python diff --git a/python-package/xgboost/spark/__init__.py b/python-package/xgboost/spark/__init__.py index c0b347eefb30..2720532c0411 100644 --- a/python-package/xgboost/spark/__init__.py +++ b/python-package/xgboost/spark/__init__.py @@ -1,6 +1,5 @@ # type: ignore -"""PySpark XGBoost integration interface -""" +"""PySpark XGBoost integration interface""" try: import pyspark @@ -11,6 +10,7 @@ SparkXGBClassifier, SparkXGBClassifierModel, SparkXGBRanker, + SparkXGBRankerModel, SparkXGBRegressor, SparkXGBRegressorModel, ) @@ -21,4 +21,5 @@ "SparkXGBRegressor", "SparkXGBRegressorModel", "SparkXGBRanker", + "SparkXGBRankerModel", ]