| 262 | } |
| 263 | |
| 264 | void 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 | } |
no test coverage detected