Recursively add thresholds.
(root)
| 2665 | If ``xgboost_style=True``, the histogram of used splitting values for the specified feature. |
| 2666 | """ |
| 2667 | def add(root): |
| 2668 | """Recursively add thresholds.""" |
| 2669 | if 'split_index' in root: # non-leaf |
| 2670 | if feature_names is not None and isinstance(feature, string_type): |
| 2671 | split_feature = feature_names[root['split_feature']] |
| 2672 | else: |
| 2673 | split_feature = root['split_feature'] |
| 2674 | if split_feature == feature: |
| 2675 | if isinstance(root['threshold'], string_type): |
| 2676 | raise LightGBMError('Cannot compute split value histogram for the categorical feature') |
| 2677 | else: |
| 2678 | values.append(root['threshold']) |
| 2679 | add(root['left_child']) |
| 2680 | add(root['right_child']) |
| 2681 | |
| 2682 | model = self.dump_model() |
| 2683 | feature_names = model.get('feature_names') |
no test coverage detected