From 39dc7c35a4ea072cdda2872ab3a5d061dc87163e Mon Sep 17 00:00:00 2001 From: Adam Valenta Date: Wed, 29 Jan 2025 13:36:44 +0100 Subject: [PATCH] GH-16466 escape sequences (#16505) * GH-16466: Fixed invalid escape sequences in docstrings Allow h2o to be imported without triggering syntax errors. Closes https://github.com/h2oai/h2o-3/issues/16466 * Adjust escape in the gen_xgboost.py --------- Co-authored-by: Justin Mahlik --- h2o-bindings/bin/custom/python/gen_xgboost.py | 2 +- h2o-py/h2o/estimators/xgboost.py | 2 +- h2o-py/h2o/model/model_base.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/h2o-bindings/bin/custom/python/gen_xgboost.py b/h2o-bindings/bin/custom/python/gen_xgboost.py index ed0e7860daa8..d257e9b73de9 100644 --- a/h2o-bindings/bin/custom/python/gen_xgboost.py +++ b/h2o-bindings/bin/custom/python/gen_xgboost.py @@ -49,7 +49,7 @@ def convert_H2OXGBoostParams_2_XGBoostParams(self): 1. Train the H2OXGBoost model with H2OFrame trainFile and generate a prediction: - - h2oModelD = H2OXGBoostEstimator(\*\*h2oParamsD) # parameters specified as a dict() + - h2oModelD = H2OXGBoostEstimator(\\*\\*h2oParamsD) # parameters specified as a dict() - h2oModelD.train(x=myX, y=y, training_frame=trainFile) # train with H2OFrame trainFile - h2oPredict = h2oPredictD = h2oModelD.predict(trainFile) diff --git a/h2o-py/h2o/estimators/xgboost.py b/h2o-py/h2o/estimators/xgboost.py index 569181c9bd7f..4ee973a68adf 100644 --- a/h2o-py/h2o/estimators/xgboost.py +++ b/h2o-py/h2o/estimators/xgboost.py @@ -2568,7 +2568,7 @@ def convert_H2OXGBoostParams_2_XGBoostParams(self): 1. Train the H2OXGBoost model with H2OFrame trainFile and generate a prediction: - - h2oModelD = H2OXGBoostEstimator(\*\*h2oParamsD) # parameters specified as a dict() + - h2oModelD = H2OXGBoostEstimator(\\*\\*h2oParamsD) # parameters specified as a dict() - h2oModelD.train(x=myX, y=y, training_frame=trainFile) # train with H2OFrame trainFile - h2oPredict = h2oPredictD = h2oModelD.predict(trainFile) diff --git a/h2o-py/h2o/model/model_base.py b/h2o-py/h2o/model/model_base.py index cff42abb03f1..b3e5f940f4b1 100644 --- a/h2o-py/h2o/model/model_base.py +++ b/h2o-py/h2o/model/model_base.py @@ -915,7 +915,7 @@ def r2(self, train=False, valid=False, xval=False): Will return :math:`R^2` for GLM Models. - The :math:`R^2` value is defined to be :math:`1 - MSE / var`, where var is computed as :math:`\sigma * \sigma`. + The :math:`R^2` value is defined to be :math:`1 - MSE / var`, where var is computed as :math:`\\sigma * \\sigma`. If all are ``False`` (default), then return the training metric value. If more than one option is set to ``True``, then return a dictionary of metrics where the keys are "train",