| 174 | } |
| 175 | |
| 176 | ui32 TBinarizedFeaturesManager::GetBinCount(ui32 localId) const { |
| 177 | if (HasBorders(localId)) { |
| 178 | return GetBorders(localId).size() + 1; |
| 179 | } else if (IsCat(localId)) { |
| 180 | return GetUniqueValuesCounts(localId).OnAll; |
| 181 | } else if (InverseCtrs.contains(localId)) { |
| 182 | return GetBinarizationDescription(InverseCtrs[localId]).BorderCount + 1; |
| 183 | } else if (IsFloat(localId)) { |
| 184 | return 0; |
| 185 | } else if (IsEstimatedFeature(localId)) { |
| 186 | return EstimatedFeatureUpperBoundHints.at(localId); |
| 187 | } else if (IsFeatureBundle(localId)) { |
| 188 | return LearnExclusiveFeatureBundles.at(FeatureManagerIdToExclusiveBundleId.at(localId)).GetBinCount(); |
| 189 | } else { |
| 190 | ythrow TCatBoostException() << "Error: unknown feature id #" << localId; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | ui32 TBinarizedFeaturesManager::AddCtr(const TCtr& ctr) { |
| 195 | CB_ENSURE(!KnownCtrs.contains(ctr)); |