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

Function BestWeightedSplit

library/cpp/grid_creator/binarization.cpp:1647–1673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1645
1646
1647THashSet<float> BestWeightedSplit(
1648 TVector<float>&& featureValues,
1649 const TVector<float>& weights,
1650 int maxBordersCount,
1651 EBorderSelectionType borderSelectionType,
1652 bool filterNans,
1653 bool featuresAreSorted
1654) {
1655 switch (borderSelectionType) {
1656 case EBorderSelectionType::MinEntropy:
1657 return BestWeightedSplit<EPenaltyType::MinEntropy>(std::move(featureValues), weights, maxBordersCount,
1658 EOptimizationType::Exact, filterNans, featuresAreSorted);
1659 case EBorderSelectionType::MaxLogSum:
1660 return BestWeightedSplit<EPenaltyType::MaxSumLog>(std::move(featureValues), weights, maxBordersCount,
1661 EOptimizationType::Exact, filterNans, featuresAreSorted);
1662 case EBorderSelectionType ::GreedyLogSum:
1663 return BestWeightedSplit<EPenaltyType::MaxSumLog>(std::move(featureValues), weights, maxBordersCount,
1664 EOptimizationType::Greedy, filterNans, featuresAreSorted);
1665 case EBorderSelectionType ::GreedyMinEntropy:
1666 return BestWeightedSplit<EPenaltyType::MinEntropy>(std::move(featureValues), weights, maxBordersCount,
1667 EOptimizationType::Greedy, filterNans, featuresAreSorted);
1668 default:
1669 const auto borderSelectionTypeName = GetEnumNames<EBorderSelectionType>().at(borderSelectionType);
1670 throw (yexception() << "Weights are unsupported for " << borderSelectionTypeName <<
1671 " border selection type.");
1672 }
1673}
1674
1675
1676template <EPenaltyType PenaltyType>

Callers

nothing calls this directly

Calls 3

yexceptionClass · 0.85
moveFunction · 0.50
atMethod · 0.45

Tested by

no test coverage detected