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

Function SumModels

catboost/libs/model/model.cpp:1845–1871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843
1844template <typename TBuilderType>
1845static void SumModels(
1846 const TVector<const TFullModel*>& modelVector,
1847 const TVector<double>& weights,
1848 const TVector<TFloatFeature>& floatFeatures,
1849 const TVector<TCatFeature>& catFeatures,
1850 bool allModelsHaveLeafWeights,
1851 ECtrTableMergePolicy ctrMergePolicy,
1852 TFullModel* sum
1853) {
1854 const auto approxDimension = modelVector.back()->GetDimensionsCount();
1855 TBuilderType builder(floatFeatures, catFeatures, {}, {}, approxDimension);
1856
1857 THashMap<TModelCtrBaseMergeKey, TCtrTablesMergeStatus> ctrTablesIndices;
1858
1859 for (const auto modelId : xrange(modelVector.size())) {
1860 TScaleAndBias normer = modelVector[modelId]->GetScaleAndBias();
1861 StreamModelTreesWithoutScaleAndBiasToBuilder(
1862 *modelVector[modelId]->ModelTrees,
1863 weights[modelId] * normer.Scale,
1864 &builder,
1865 allModelsHaveLeafWeights,
1866 ctrMergePolicy,
1867 &ctrTablesIndices
1868 );
1869 }
1870 builder.Build(sum->ModelTrees.GetMutable());
1871}
1872
1873TFullModel SumModels(
1874 const TVector<const TFullModel*> modelVector,

Callers 5

mode_model_sumFunction · 0.85
Y_UNIT_TESTFunction · 0.85
SaveModelFunction · 0.85
CatBoostSumModels_RFunction · 0.85

Calls 15

xrangeFunction · 0.85
IsAllObliviousFunction · 0.85
IsAllNonSymmetricFunction · 0.85
MergeCtrProvidersDataFunction · 0.85
CreateGuidAsStringFunction · 0.85
SumModelsParamsFunction · 0.85
GetMutableMethod · 0.80
GetTextFeaturesMethod · 0.80
GetEmbeddingFeaturesMethod · 0.80
GetLeafWeightsMethod · 0.80

Tested by

no test coverage detected