| 1645 | |
| 1646 | |
| 1647 | THashSet<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 | |
| 1676 | template <EPenaltyType PenaltyType> |
nothing calls this directly
no test coverage detected