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

Function IsCatFeatureToBeBinarized

catboost/libs/data/quantization.cpp:2120–2142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2118 }
2119
2120 static bool IsCatFeatureToBeBinarized(
2121 const TQuantizationOptions& options,
2122 TQuantizedFeaturesInfo& quantizedFeaturesInfo, // non const because of GetRWMutex
2123 TCatFeatureIdx catFeatureIdx
2124 ) {
2125 if (!options.PackBinaryFeaturesForCpu) {
2126 return false;
2127 }
2128
2129 {
2130 TReadGuard guard(quantizedFeaturesInfo.GetRWMutex());
2131
2132 if (quantizedFeaturesInfo.GetFeaturesLayout()->GetInternalFeatureMetaInfo(
2133 *catFeatureIdx,
2134 EFeatureType::Categorical
2135 ).IsAvailable &&
2136 (quantizedFeaturesInfo.GetUniqueValuesCounts(catFeatureIdx).OnAll == 2))
2137 {
2138 return true;
2139 }
2140 }
2141 return false;
2142 }
2143
2144 static void AddIgnoredFeatures(const TFeaturesLayout& addFromLayout, TFeaturesLayout* updatedLayout) {
2145 auto featuresIntersectionSize = Min(

Callers 1

DoMethod · 0.85

Calls 2

GetFeaturesLayoutMethod · 0.45
GetUniqueValuesCountsMethod · 0.45

Tested by

no test coverage detected