| 12 | |
| 13 | namespace { |
| 14 | struct TFloatFeatureBucketRange { |
| 15 | int FeatureIdx = -1; |
| 16 | int Start = 0; |
| 17 | int End = -1; |
| 18 | int NumOfBuckets = 0; |
| 19 | |
| 20 | TFloatFeatureBucketRange() = default; |
| 21 | |
| 22 | TFloatFeatureBucketRange(int featureIdx, int numOfBorders) |
| 23 | : FeatureIdx(featureIdx) |
| 24 | , Start(0) |
| 25 | , End(numOfBorders + 1) |
| 26 | , NumOfBuckets(numOfBorders + 1) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | void Update(int borderIdx, bool isGreater) { |
| 31 | if (isGreater && borderIdx >= Start) { |
| 32 | Start = borderIdx + 1; |
| 33 | } else if (!isGreater && borderIdx < End) { |
| 34 | End = borderIdx + 1; |
| 35 | } |
| 36 | } |
| 37 | }; |
| 38 | } //anonymous |
| 39 | |
| 40 | TVector<TFloatFeatureBucketRange> PrepareFeatureRanges( |
no outgoing calls
no test coverage detected