Skip to content

Latest commit

 

History

History
64 lines (38 loc) · 2.46 KB

python.md

File metadata and controls

64 lines (38 loc) · 2.46 KB

Python API for XGBoost-Spark

This doc focuses on GPU related Python API interfaces. Four new classes are introduced to support ML things on spark.

XGBoostClassifier

The full name is ml.dmlc.xgboost4j.scala.spark.XGBoostClassifier. It is a wrapper around Scala XGBoostClassifier.

Constructors
  • XGBoostClassifier(**params)
    • all standard xgboost parameters are supported, but please note a few differences:
      • only camelCase is supported when specifying parameter names, e.g., maxDepth
      • parameter lambda is renamed to lambda_, because lambda is a keyword in Python
Methods

Note: Only GPU related methods are listed below.

  • setFeaturesCols(features_cols). This method sets the feature columns for training.
    • features_cols: a list of feature column names in String format to set
    • returns the classifier itself

XGBoostClassificationModel

The full name is ml.dmlc.xgboost4j.scala.spark.XGBoostClassificationModel. It is a wrapper around Scala XGBoostClassificationModel.

Methods

No GPU specific methods, use it as a normal spark model.

XGBoostRegressor

The full name is ml.dmlc.xgboost4j.scala.spark.XGBoostRegressor. It is a wrapper around Scala XGBoostRegressor.

Constructors
  • XGBoostRegressor(**params)
    • all standard xgboost parameters are supported, but please note a few differences:
      • only camelCase is supported when specifying parameter names, e.g., maxDepth
      • parameter lambda is renamed to lambda_, because lambda is a keyword in Python
Methods

Note: Only GPU related methods are listed below.

  • setFeaturesCols(features_cols). This method sets the feature columns for training.
    • features_cols: a list of feature column names in String format to set
    • returns the regressor itself

XGBoostRegressionModel

The full name is ml.dmlc.xgboost4j.scala.spark.XGBoostRegressionModel. It is a wrapper around Scala XGBoostRegressionModel.

Methods

No GPU specific methods, use it as a normal spark model.