| 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( |
no test coverage detected