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

Method GetBlockIterator

catboost/libs/data/external_columns.cpp:26–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 IDynamicBlockIteratorBasePtr TExternalFloatValuesHolder::GetBlockIterator(ui32 offset) const {
27 const auto floatFeatureIdx = QuantizedFeaturesInfo->GetPerTypeFeatureIdx<EFeatureType::Float>(*this);
28 const auto nanMode = QuantizedFeaturesInfo->GetNanMode(floatFeatureIdx);
29
30 // it's ok even if it is learn data, for learn nans are checked at CalcBordersAndNanMode stage
31 bool allowNans = (nanMode != ENanMode::Forbidden) ||
32 QuantizedFeaturesInfo->GetFloatFeaturesAllowNansInTestOnly();
33 auto featureIdx = GetId();
34
35 auto transformer = [
36 allowNans, nanMode, featureIdx,
37 bordersArrRef = MakeArrayRef(QuantizedFeaturesInfo->GetBorders(floatFeatureIdx))
38 ] (TConstArrayRef<float> src, auto& dst) {
39 QuantizeBlock(
40 src,
41 allowNans,
42 nanMode,
43 featureIdx,
44 bordersArrRef,
45 MakeArrayRef(dst)
46 );
47 };
48 if (QuantizedFeaturesInfo->GetBorders(floatFeatureIdx).size() < 256) {
49 return MakeBlockTransformerIterator<ui8>(
50 SrcData->GetBlockIterator(offset),
51 std::move(transformer)
52 );
53 } else {
54 return MakeBlockTransformerIterator<ui16>(
55 SrcData->GetBlockIterator(offset),
56 std::move(transformer)
57 );
58 }
59 }
60
61
62 THolder<IFeatureValuesHolder> TExternalCatValuesHolder::CloneWithNewSubsetIndexing(

Callers 6

CheckMethod · 0.45
CreateHashedCatValuesMethod · 0.45
ComputeNanModeMethod · 0.45
ProcessDenseColumnMethod · 0.45
SimpleEqualFunction · 0.45
CompareObjectsDataFunction · 0.45

Calls 9

MakeArrayRefFunction · 0.85
QuantizeBlockFunction · 0.85
xrangeFunction · 0.85
moveFunction · 0.50
GetNanModeMethod · 0.45
GetBordersMethod · 0.45
sizeMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected