(feature)
| 3975 | raise ImportError(str(e)) |
| 3976 | |
| 3977 | def getFeatureIdx(feature): |
| 3978 | if not isinstance(feature, int): |
| 3979 | if self.feature_names_ is None or feature not in self.feature_names_: |
| 3980 | raise CatBoostError('No feature named "{}" in model'.format(feature)) |
| 3981 | feature_idx = self.feature_names_.index(feature) |
| 3982 | else: |
| 3983 | feature_idx = feature |
| 3984 | assert feature_idx in self._get_borders(), "only float features indexes are supported" |
| 3985 | assert len(self._get_borders()[feature_idx]) > 0, "feature with idx {} is not used in model".format(feature_idx) |
| 3986 | return feature_idx |
| 3987 | |
| 3988 | def getFeatureIndices(features): |
| 3989 | if isinstance(features, list) or isinstance(features, tuple): |
nothing calls this directly
no test coverage detected