From 1f1db84b72bf046d0b6f1ae1f7cbbe423b4c6955 Mon Sep 17 00:00:00 2001 From: Hyunsu Cho Date: Wed, 27 May 2020 03:09:46 -0700 Subject: [PATCH] [Doc] Fix typos in AFT tutorial --- doc/tutorials/aft_survival_analysis.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/tutorials/aft_survival_analysis.rst b/doc/tutorials/aft_survival_analysis.rst index 80bad9ad0b3a..ca99ceb9c0db 100644 --- a/doc/tutorials/aft_survival_analysis.rst +++ b/doc/tutorials/aft_survival_analysis.rst @@ -35,7 +35,7 @@ There are four kinds of censoring: * **Uncensored**: the label is not censored and given as a single number. * **Right-censored**: the label is of form :math:`[a, +\infty)`, where :math:`a` is the lower bound. -* **Left-censored**: the label is of form :math:`(-\infty, b]`, where :math:`b` is the upper bound. +* **Left-censored**: the label is of form :math:`[0, b]`, where :math:`b` is the upper bound. * **Interval-censored**: the label is of form :math:`[a, b]`, where :math:`a` and :math:`b` are the lower and upper bounds, respectively. Right-censoring is the most commonly used. @@ -83,7 +83,7 @@ Censoring type Interval form Lower bound finite? Upper bound finite? ================= ==================== =================== =================== Uncensored :math:`[a, a]` |tick| |tick| Right-censored :math:`[a, +\infty)` |tick| |cross| -Left-censored :math:`(-\infty, b]` |cross| |tick| +Left-censored :math:`[0, b]` |tick| |tick| Interval-censored :math:`[a, b]` |tick| |tick| ================= ==================== =================== =================== @@ -102,7 +102,7 @@ Collect the lower bound numbers in one array (let's call it ``y_lower_bound``) a # Associate ranged labels with the data matrix. # This example shows each kind of censored labels. # uncensored right left interval - y_lower_bound = np.array([ 2.0, 3.0, -np.inf, 4.0]) + y_lower_bound = np.array([ 2.0, 3.0, 0.0, 4.0]) y_upper_bound = np.array([ 2.0, +np.inf, 4.0, 5.0]) dtrain.set_float_info('label_lower_bound', y_lower_bound) dtrain.set_float_info('label_upper_bound', y_upper_bound) @@ -120,7 +120,7 @@ Collect the lower bound numbers in one array (let's call it ``y_lower_bound``) a # Associate ranged labels with the data matrix. # This example shows each kind of censored labels. # uncensored right left interval - y_lower_bound <- c( 2., 3., -Inf, 4.) + y_lower_bound <- c( 2., 3., 0., 4.) y_upper_bound <- c( 2., +Inf, 4., 5.) setinfo(dtrain, 'label_lower_bound', y_lower_bound) setinfo(dtrain, 'label_upper_bound', y_upper_bound) @@ -136,7 +136,7 @@ Now we are ready to invoke the training API: 'aft_loss_distribution_scale': 1.20, 'tree_method': 'hist', 'learning_rate': 0.05, 'max_depth': 2} bst = xgb.train(params, dtrain, num_boost_round=5, - evals=[(dtrain, 'train'), (dvalid, 'valid')]) + evals=[(dtrain, 'train')]) .. code-block:: r :caption: R @@ -165,4 +165,4 @@ Currently, you can choose from three probability distributions for ``aft_loss_di ``extreme`` :math:`e^z e^{-\exp{z}}` ========================= =========================================== -Note that it is not yet possible to set the ranged label using the scikit-learn interface (e.g. :class:`xgboost.XGBRegressor`). For now, you should use :class:`xgboost.train` with :class:`xgboost.DMatrix`. \ No newline at end of file +Note that it is not yet possible to set the ranged label using the scikit-learn interface (e.g. :class:`xgboost.XGBRegressor`). For now, you should use :class:`xgboost.train` with :class:`xgboost.DMatrix`.