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

Function CalcAndOutputPredictionDiff

catboost/libs/fstr/compare_documents.cpp:264–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void CalcAndOutputPredictionDiff(
265 const TFullModel& model,
266 const NCB::TDataProvider& dataProvider,
267 const TString& outputPath,
268 NPar::ILocalExecutor* localExecutor
269) {
270 auto factorImpact = GetPredictionDiff(model, dataProvider, localExecutor);
271 TVector<std::pair<double, int>> impacts;
272 for (const auto& impact: factorImpact) {
273 impacts.push_back({impact[0], impacts.size()});
274 }
275 StableSort(impacts.begin(), impacts.end(), std::greater<std::pair<double, int>>());
276
277 TFileOutput out(outputPath);
278 for (const auto& impact: impacts) {
279 out << impact.first << " " << impact.second << Endl;
280 }
281}

Callers 1

Calls 6

GetPredictionDiffFunction · 0.85
StableSortFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected