Fix XGBoost regressor "used before assignment"

This commit is contained in:
Matthias 2022-10-25 13:37:04 +02:00 committed by GitHub
parent 283dab667d
commit 1ef38f137d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ class XGBoostRFRegressor(BaseRegressionModel):
if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) == 0: if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) == 0:
eval_set = None eval_set = None
eval_weights = None
else: else:
eval_set = [(data_dictionary["test_features"], data_dictionary["test_labels"])] eval_set = [(data_dictionary["test_features"], data_dictionary["test_labels"])]
eval_weights = [data_dictionary['test_weights']] eval_weights = [data_dictionary['test_weights']]

View File

@ -29,6 +29,7 @@ class XGBoostRegressor(BaseRegressionModel):
if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) == 0: if self.freqai_info.get("data_split_parameters", {}).get("test_size", 0.1) == 0:
eval_set = None eval_set = None
eval_weights = None
else: else:
eval_set = [(data_dictionary["test_features"], data_dictionary["test_labels"])] eval_set = [(data_dictionary["test_features"], data_dictionary["test_labels"])]
eval_weights = [data_dictionary['test_weights']] eval_weights = [data_dictionary['test_weights']]