add ctr-merge-policy paramter to CLI model sum
#include <library/getopt/small/last_getopt.h>
+#include <util/generic/serialized_enum.h>
+
int mode_model_sum(int argc, const char* argv[]) {
TVector<std::pair<TString, double>> modelPathsWithWeights;
TString outputModelPath;
+ ECtrTableMergePolicy ctrMergePolicy = ECtrTableMergePolicy::IntersectingCountersAverage;
+
auto parser = NLastGetopt::TOpts();
parser.AddHelpOption();
parser.AddLongOption('m', "model", "Model path with default weight 1.0")
@@ -22,6 +26,13 @@ int mode_model_sum(int argc, const char* argv[]) {
.Required()
.RequiredArgument("PATH")
.StoreResult(&outputModelPath);
+
+ parser.AddLongOption("ctr-merge-policy",
+ TString::Join(
+ "One of ",
+ GetEnumAllNames<ECtrTableMergePolicy>()))
+ .Optional()
+ .StoreResult(&ctrMergePolicy);
parser.SetFreeArgsNum(0);
NLastGetopt::TOptsParseResult parserResult{&parser, argc, argv};
TVector<THolder<TFullModel>> models;
@@ -32,7 +43,7 @@ int mode_model_sum(int argc, const char* argv[]) {
modelPtrs.emplace_back(models.back().Get());
weights.emplace_back(weight);
}
- TFullModel result = SumModels(modelPtrs, weights);
+ TFullModel result = SumModels(modelPtrs, weights, ctrMergePolicy);
OutputModel(result, outputModelPath);
return 0;
}
