TODO(akhropov): maybe use different sample selection logic for sparse data
| 116 | |
| 117 | // TODO(akhropov): maybe use different sample selection logic for sparse data |
| 118 | static TSubsetIndexingForBuildBorders GetSubsetForBuildBorders( |
| 119 | const TFeaturesArraySubsetIndexing& srcIndexing, |
| 120 | const TFeaturesLayout& featuresLayoutForQuantization, |
| 121 | const TQuantizedFeaturesInfo& quantizedFeaturesInfo, |
| 122 | EObjectsOrder srcObjectsOrder, |
| 123 | const TQuantizationOptions& options, |
| 124 | TRestorableFastRng64* rand, |
| 125 | NPar::ILocalExecutor* localExecutor |
| 126 | ) { |
| 127 | if (NeedToCalcBorders(featuresLayoutForQuantization, quantizedFeaturesInfo)) { |
| 128 | TFeaturesArraySubsetIndexing subsetIndexing = GetArraySubsetForBuildBorders( |
| 129 | srcIndexing.Size(), |
| 130 | /*TODO(kirillovs): iterate through all per feature binarization settings and select smallest |
| 131 | * sample size |
| 132 | */ |
| 133 | quantizedFeaturesInfo.GetFloatFeatureBinarization(Max<ui32>()).BorderSelectionType, |
| 134 | srcObjectsOrder == EObjectsOrder::RandomShuffled, |
| 135 | options.MaxSubsetSizeForBuildBordersAlgorithms, |
| 136 | rand |
| 137 | ); |
| 138 | return TSubsetIndexingForBuildBorders(srcIndexing, subsetIndexing, localExecutor); |
| 139 | } else { |
| 140 | return TSubsetIndexingForBuildBorders(); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | template <class TColumn> |
| 145 | static ui32 GetNonDefaultValuesCount(const TColumn& srcFeature) { |
no test coverage detected