Open csetzkorn opened 2 years ago
I'm experiencing the same issue, and have tried setting the constraints to be a tuple and for it to be the string representation of the tuple. I followed the resolution of this issue https://github.com/aws/sagemaker-xgboost-container/issues/120 precisely, but have a similar error message to yours.
AlgorithmError: framework error: Traceback (most recent call last): File "/miniconda3/lib/python3.8/site-packages/sagemaker_containers/_trainer.py", line 84, in train entrypoint() File "/miniconda3/lib/python3.8/site-packages/sagemaker_xgboost_container/training.py", line 93, in main train(framework.training_env()) File "/miniconda3/lib/python3.8/site-packages/sagemaker_xgboost_container/training.py", line 89, in train run_algorithm_mode() File "/miniconda3/lib/python3.8/site-packages/sagemaker_xgboost_container/training.py", line 63, in run_algorithm_mode sagemaker_train( File "/miniconda3/lib/python3.8/site-packages/sagemaker_xgboost_container/algorithm_mode/train.py", line 122, in sagemaker_train validated_train_config = hyperparameters.validate(train_config) File "/miniconda3/lib/python3.8/site-packages/sagemaker_algorithm_toolkit/hyperparameter_validation.py", line 306, in validate self.hyperparameters[hp].validate_dependencies(value, dependencies) File "/miniconda3
I would also like to know how to set these constraints via the console. I am experiencing the same issue.
any news on this please? just looking at this again
Let is assume I have a dataset with 3 independent valiables/predictors/features. So far I used code along those lines successfully:
However, when I try to impose a monotonicity constraint on the 2nd feature like so:
Any ideas? Maybe this is not possible for the "built-in algorithm"?
PS:
Errors:
Traceback (most recent call last): File "c:\Repos\ds_cs_ipt2\modeling\fit_occupancy_model_in_sagemaker.py", line 67, in <module> estimator.fit({'train': s3_input_train, 'validation': s3_input_val}) File "C:\Python\Python310\lib\site-packages\sagemaker\estimator.py", line 956, in fit self.latest_training_job.wait(logs=logs) File "C:\Python\Python310\lib\site-packages\sagemaker\estimator.py", line 1957, in wait self.sagemaker_session.logs_for_job(self.job_name, wait=True, log_type=logs) File "C:\Python\Python310\lib\site-packages\sagemaker\session.py", line 3798, in logs_for_job self._check_job_status(job_name, description, "TrainingJobStatus") File "C:\Python\Python310\lib\site-packages\sagemaker\session.py", line 3336, in _check_job_status raise exceptions.UnexpectedStatusException( sagemaker.exceptions.UnexpectedStatusException: Error for Training job sagemaker-xgboost-2022-05-25-11-11-03-685: Failed. Reason: AlgorithmError: framework error: Traceback (most recent call last): File "/miniconda3/lib/python3.7/site-packages/sagemaker_xgboost_container/algorithm_mode/train.py", line 233, in train_job feval=configured_feval, callbacks=callbacks, xgb_model=xgb_model, verbose_eval=False) File "/miniconda3/lib/python3.7/site-packages/xgboost/training.py", line 196, in train early_stopping_rounds=early_stopping_rounds) File "/miniconda3/lib/python3.7/site-packages/xgboost/training.py", line 51, in _train_internal bst = Booster(params, [dtrain] + [d[0] for d in evals]) File "/miniconda3/lib/python3.7/site-packages/xgboost/core.py", line 1334, in __init__ params = self._configure_constraints(params) File "/miniconda3/lib/python3.7/site-packages/xgboost/core.py", line 1400, in _configure_constraints ] = self._transform_monotone_constrains(value) File "/miniconda3/lib/python3.7/site-packages/xgboost/core.py", line 1361, in _transform_monotone_constrains constrained_features = set(value.keys