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

Function GetRawTargetSubset

catboost/libs/data/target.cpp:488–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488static void GetRawTargetSubset(
489 const TRawTarget& src,
490 const TArraySubsetIndexing<ui32>& subset,
491 NPar::ILocalExecutor* localExecutor,
492 TRawTarget* dst
493) {
494 if (const ITypedSequencePtr<float>* srcTypedSequence = std::get_if<ITypedSequencePtr<float>>(&src)) {
495 ITypedArraySubsetPtr<float> typedArraySubset = (*srcTypedSequence)->GetSubset(&subset);
496 TVector<float> dstData;
497 dstData.yresize(subset.Size());
498 TArrayRef<float> dstDataRef = dstData;
499 typedArraySubset->ParallelForEach(
500 [dstDataRef] (ui32 idx, float value) { dstDataRef[idx] = value; },
501 localExecutor
502 );
503 (*dst) = (ITypedSequencePtr<float>)MakeIntrusive<TTypeCastArrayHolder<float, float>>(
504 std::move(dstData)
505 );
506 } else {
507 (*dst) = GetSubset<TString>(std::get<TVector<TString>>(src), subset, localExecutor);
508 }
509}
510
511
512static void GetMultidimBaselineSubset(

Callers 1

GetSubsetMethod · 0.85

Calls 5

yresizeMethod · 0.80
moveFunction · 0.50
GetSubsetMethod · 0.45
SizeMethod · 0.45
ParallelForEachMethod · 0.45

Tested by

no test coverage detected