MCPcopy Create free account
hub / github.com/catboost/catboost / GroupAndSortValues

Function GroupAndSortValues

library/cpp/grid_creator/binarization.cpp:1613–1640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

BestSplitMethod · 0.85

Calls 4

moveFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected