From df6a1feb058348cd7b368b6c77f8553400780e03 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Tue, 16 Jan 2024 01:47:37 +0800 Subject: [PATCH] Fix quantile regression demo. --- demo/guide-python/quantile_regression.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/guide-python/quantile_regression.py b/demo/guide-python/quantile_regression.py index 5d186714c7bd..a9e4532ba7ca 100644 --- a/demo/guide-python/quantile_regression.py +++ b/demo/guide-python/quantile_regression.py @@ -46,10 +46,11 @@ def quantile_loss(args: argparse.Namespace) -> None: X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=rng) # We will be using the `hist` tree method, quantile DMatrix can be used to preserve - # memory. + # memory (which has nothing to do with quantile regression itself, see its document + # for details). # Do not use the `exact` tree method for quantile regression, otherwise the # performance might drop. - Xy = xgb.QuantileDMatrix(X, y) + Xy = xgb.QuantileDMatrix(X_train, y_train) # use Xy as a reference Xy_test = xgb.QuantileDMatrix(X_test, y_test, ref=Xy)