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

Function MakeIndicesVector

catboost/libs/model/model.cpp:1345–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1343
1344template <typename T>
1345TVector<size_t> MakeIndicesVector(const TConstArrayRef<T>& features) {
1346 TVector<size_t> indices;
1347 indices.reserve(features.size());
1348 for (const auto& feature : features) {
1349 indices.push_back(SafeIntegerCast<size_t>(feature.Position.FlatIndex));
1350 }
1351 return indices;
1352}
1353
1354TVector<size_t> GetModelCatFeaturesIndices(const TFullModel& model) {
1355 return MakeIndicesVector(model.ModelTrees->GetCatFeatures());

Calls 3

reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected