| 1611 | } |
| 1612 | |
| 1613 | std::pair<TVector<float>, TVector<float>> GroupAndSortValues( |
| 1614 | TFeatureValues&& features, |
| 1615 | bool filterNans, |
| 1616 | bool cumulativeWeights) { |
| 1617 | |
| 1618 | if (features.DefaultValue) { |
| 1619 | features.Values.push_back(features.DefaultValue->Value); |
| 1620 | const size_t defaultValuePosition = features.Values.size() - 1; |
| 1621 | return GroupAndSortWeighedValuesImpl( |
| 1622 | std::move(features.Values), |
| 1623 | TSingleValueWeightedIterator<float>( |
| 1624 | 1.0f, |
| 1625 | defaultValuePosition, |
| 1626 | (float)features.DefaultValue->Count), |
| 1627 | filterNans, |
| 1628 | /*isSorted*/ false, |
| 1629 | /*normalizeWeights*/ false, |
| 1630 | cumulativeWeights); |
| 1631 | } else { |
| 1632 | return GroupAndSortWeighedValuesImpl( |
| 1633 | std::move(features.Values), |
| 1634 | TRepeatIterator<float>(1.0f), |
| 1635 | filterNans, |
| 1636 | features.ValuesSorted, |
| 1637 | /*normalizeWeights*/ false, |
| 1638 | cumulativeWeights); |
| 1639 | } |
| 1640 | } |
| 1641 | |
| 1642 | } |
| 1643 |
no test coverage detected