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

Function GetFeaturesUsedInModel

catboost/tools/model_perftest/lib/main.cpp:146–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145
146TVector<bool> GetFeaturesUsedInModel(const TFullModel& model) {
147 TVector<bool> result(model.ModelTrees->GetFlatFeatureVectorExpectedSize(), false);
148
149 for (const auto& floatFeature : model.ModelTrees->GetFloatFeatures()) {
150 if (floatFeature.UsedInModel()) {
151 result[floatFeature.Position.FlatIndex] = true;
152 }
153 }
154
155 for (const auto& catFeature : model.ModelTrees->GetCatFeatures()) {
156 if (catFeature.UsedInModel()) {
157 result[catFeature.Position.FlatIndex] = true;
158 }
159 }
160
161 return result;
162}
163
164
165int DoMain(int argc, char** argv) {

Callers 1

DoMainFunction · 0.85

Calls 4

GetFloatFeaturesMethod · 0.80
GetCatFeaturesMethod · 0.80
UsedInModelMethod · 0.45

Tested by

no test coverage detected