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

Method Load

catboost/libs/data/target.cpp:897–949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895}
896
897void TProcessedTargetData::Load(IBinSaver* binSaver) {
898 TSerializationTargetDataCache cache;
899 LoadMulti(binSaver, &cache);
900
901 LoadMulti(binSaver, &TargetsClassCount);
902 LoadWithCache(cache.Weights, binSaver, &Weights);
903
904 ui32 targetCount = 0;
905 LoadMulti(binSaver, &targetCount);
906 for (ui32 targetIdx : xrange(targetCount)) {
907 Y_UNUSED(targetIdx);
908
909 TString name;
910 ui32 dimensionCount;
911 LoadMulti(binSaver, &name, &dimensionCount);
912
913 TVector<TSharedVector<float>> target;
914 target.reserve(dimensionCount);
915 for (ui32 dimensionIdx : xrange(dimensionCount)) {
916 Y_UNUSED(dimensionIdx);
917
918 ui64 id;
919 LoadMulti(binSaver, &id);
920 target.push_back(cache.Targets.at(id));
921 }
922
923 Targets.emplace(name, std::move(target));
924 }
925
926 ui32 baselineCount = 0;
927 LoadMulti(binSaver, &baselineCount);
928 for (ui32 baselineIdx : xrange(baselineCount)) {
929 Y_UNUSED(baselineIdx);
930
931 TString name;
932 ui32 dimensionCount;
933 LoadMulti(binSaver, &name, &dimensionCount);
934
935 TVector<TSharedVector<float>> baseline;
936 baseline.reserve(dimensionCount);
937 for (ui32 dimensionIdx : xrange(dimensionCount)) {
938 Y_UNUSED(dimensionIdx);
939
940 ui64 id;
941 LoadMulti(binSaver, &id);
942 baseline.push_back(cache.Baselines.at(id));
943 }
944
945 Baselines.emplace(name, std::move(baseline));
946 }
947
948 LoadWithCache(cache.GroupInfos, binSaver, &GroupInfos);
949}
950
951
952template <class TSharedDataPtr>

Calls 9

LoadMultiFunction · 0.85
LoadWithCacheFunction · 0.85
xrangeFunction · 0.85
Y_UNUSEDFunction · 0.85
moveFunction · 0.50
reserveMethod · 0.45
push_backMethod · 0.45
atMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected