File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -779,6 +779,8 @@ def _prepare_rules(self):
779779 if self .rules is not None :
780780 for rule in self .rules :
781781 if isinstance (rule , Rule ):
782+ # Add check for xgboost rules
783+ self ._check_debugger_rule (rule )
782784 self .debugger_rules .append (rule )
783785 elif isinstance (rule , ProfilerRule ):
784786 self .profiler_rules .append (rule )
@@ -788,6 +790,16 @@ def _prepare_rules(self):
788790 + "and sagemaker.debugger.ProfilerRule"
789791 )
790792
793+ def _check_debugger_rule (self , rule ):
794+ """Add warning for incorrectly used xgboost rules."""
795+ _xgboost_specific_rules = ["FeatureImportanceOverweight" , "TreeDepth" ]
796+ if rule .name in _xgboost_specific_rules :
797+ logger .warning (
798+ "TreeDepth and FeatureImportanceOverweight rules are valid "
799+ "only for the XGBoost algorithm. Please make sure this estimator "
800+ "is used for XGBoost algorithm. "
801+ )
802+
791803 def _prepare_debugger_for_training (self ):
792804 """Prepare debugger rules and debugger configs for training."""
793805 if self .debugger_rules and self .debugger_hook_config is None :
You can’t perform that action at this time.
0 commit comments