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

Function ClearFloatFeatures

catboost/libs/carry_model/carry.cpp:83–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 void ClearFloatFeatures(
84 TVector<TFloatFeature>& floatFeatures,
85 const TVector<TFeaturePosition>& factorToRemove
86 ) {
87 EraseIf(floatFeatures, [&factorToRemove](const auto& factor) {
88 return FindIf(factorToRemove, [&factor](const auto& toRemove) {
89 return factor.Position.Index == toRemove.Index;
90 }) != factorToRemove.end();
91 });
92
93 for (auto& feature : floatFeatures) {
94 const auto shift = CountIf(factorToRemove, [&feature](const auto& toRemove) {
95 return feature.Position.FlatIndex > toRemove.FlatIndex;
96 });
97 feature.Position.Index -= shift;
98 feature.Position.FlatIndex -= shift;
99 }
100 }
101
102 void ClearCatFeatures(
103 TVector<TCatFeature>& catFeatures,

Callers 2

CarryModelFunction · 0.85
UpliftModelFunction · 0.85

Calls 4

FindIfFunction · 0.85
EraseIfFunction · 0.50
CountIfFunction · 0.50
endMethod · 0.45

Tested by

no test coverage detected