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

Function PushBackEvalPrinters

catboost/libs/eval_result/column_printer.cpp:13–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11namespace NCB {
12
13 void PushBackEvalPrinters(
14 const TVector<TVector<TVector<double>>>& rawValues,
15 const EPredictionType predictionType,
16 const TString& lossFunctionName,
17 const TMaybe<TString>& modelName,
18 bool isMultiTarget,
19 size_t ensemblesCount,
20 const TExternalLabelsHelper& visibleLabelsHelper,
21 TMaybe<std::pair<size_t, size_t>> evalParameters,
22 TVector<THolder<IColumnPrinter>>* result,
23 NPar::ILocalExecutor* executor,
24 double binClassLogitThreshold
25 ) {
26 int begin = 0;
27 const bool callMakeExternalApprox
28 = visibleLabelsHelper.IsInitialized()
29 && (visibleLabelsHelper.GetExternalApproxDimension() > 1)
30 && !IsUncertaintyPredictionType(predictionType);
31 for (const auto& raws : rawValues) {
32 const auto& approx = callMakeExternalApprox ? MakeExternalApprox(raws, visibleLabelsHelper) : raws;
33 auto approxes = PrepareEval(
34 predictionType,
35 ensemblesCount,
36 lossFunctionName,
37 approx,
38 executor,
39 binClassLogitThreshold
40 );
41 const auto& headers = CreatePredictionTypeHeader(
42 approx.size(),
43 isMultiTarget,
44 predictionType,
45 visibleLabelsHelper,
46 lossFunctionName,
47 modelName,
48 ensemblesCount,
49 begin,
50 evalParameters.Get()
51 );
52 if (!lossFunctionName.empty() && IsMultiLabelObjective(lossFunctionName)) {
53 for (int i = 0; i < approxes.ysize(); ++i) {
54 result->push_back(MakeHolder<TArrayPrinter<double>>(std::move(approxes[i]), headers[i]));
55 }
56 } else {
57 for (int i = 0; i < approxes.ysize(); ++i) {
58 result->push_back(
59 MakeHolder<TEvalPrinter>(predictionType, headers[i], approxes[i], visibleLabelsHelper)
60 );
61 }
62 }
63 if (evalParameters) {
64 begin += evalParameters->first;
65 }
66 }
67 }
68
69 TVector<TString> CreatePredictionTypeHeaderForUncertainty(
70 EPredictionType predictionType,

Callers 1

InitializeColumnWriterFunction · 0.85

Calls 13

MakeExternalApproxFunction · 0.85
PrepareEvalFunction · 0.85
IsMultiLabelObjectiveFunction · 0.85
moveFunction · 0.50
IsInitializedMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
emptyMethod · 0.45
ysizeMethod · 0.45

Tested by

no test coverage detected