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

Method DbgDumpQuantizedFeatures

catboost/libs/data/objects.cpp:1279–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1277
1278
1279void NCB::DbgDumpQuantizedFeatures(
1280 const NCB::TQuantizedObjectsDataProvider& quantizedObjectsDataProvider,
1281 IOutputStream* out
1282) {
1283 const auto& featuresLayout = *quantizedObjectsDataProvider.GetFeaturesLayout();
1284
1285 NPar::TLocalExecutor localExecutor;
1286
1287 featuresLayout.IterateOverAvailableFeatures<EFeatureType::Float>(
1288 [&] (TFloatFeatureIdx floatFeatureIdx) {
1289 auto feature = quantizedObjectsDataProvider.GetFloatFeature(*floatFeatureIdx);
1290 if (!feature)
1291 return;
1292
1293 (*feature)->ForEachBlock(
1294 [out, floatFeatureIdx] (size_t blockStartOffset, auto block) {
1295 for (auto i : xrange(block.size())) {
1296 auto objectIdx = i + blockStartOffset;
1297 (*out) << "(floatFeature=" << *floatFeatureIdx << ',' << LabeledOutput(objectIdx)
1298 << ").bin=" << ui32(block[i]) << Endl;
1299 }
1300 }
1301 );
1302 }
1303 );
1304
1305 featuresLayout.IterateOverAvailableFeatures<EFeatureType::Categorical>(
1306 [&] (TCatFeatureIdx catFeatureIdx) {
1307 auto feature = quantizedObjectsDataProvider.GetCatFeature(*catFeatureIdx);
1308 if (!feature)
1309 return;
1310
1311 (*feature)->ForEachBlock(
1312 [out, catFeatureIdx] (size_t blockStartOffset, auto block) {
1313 for (auto i : xrange(block.size())) {
1314 auto objectIdx = i + blockStartOffset;
1315 (*out) << "(catFeature=" << *catFeatureIdx << ',' << LabeledOutput(objectIdx)
1316 << ").bin=" << ui32(block[i]) << Endl;
1317 }
1318 }
1319 );
1320 }
1321 );
1322}
1323
1324
1325NCB::TExclusiveFeatureBundlesData::TExclusiveFeatureBundlesData(

Callers

nothing calls this directly

Calls 6

xrangeFunction · 0.85
ForEachBlockMethod · 0.80
GetFeaturesLayoutMethod · 0.45
GetFloatFeatureMethod · 0.45
sizeMethod · 0.45
GetCatFeatureMethod · 0.45

Tested by

no test coverage detected