| 168 | } |
| 169 | |
| 170 | TVector<std::pair<double, TFeature>> CalcFeatureEffect( |
| 171 | const TFullModel& model, |
| 172 | const TDataProviderPtr dataset, |
| 173 | EFstrType type, |
| 174 | NPar::ILocalExecutor* localExecutor, |
| 175 | ECalcTypeShapValues calcType) |
| 176 | { |
| 177 | type = AdjustFeatureImportanceType(type, model.GetLossFunctionName()); |
| 178 | if (type != EFstrType::PredictionValuesChange) { |
| 179 | CB_ENSURE_SCALE_IDENTITY(model.GetScaleAndBias(), "feature effect"); |
| 180 | } |
| 181 | if (type == EFstrType::LossFunctionChange) { |
| 182 | CB_ENSURE( |
| 183 | dataset, |
| 184 | "Dataset is not provided for " << EFstrType::LossFunctionChange << ", choose " |
| 185 | << EFstrType::PredictionValuesChange << " fstr type explicitly or provide dataset."); |
| 186 | return CalcFeatureEffectLossChange(model, dataset, localExecutor, calcType); |
| 187 | } else { |
| 188 | CB_ENSURE_INTERNAL( |
| 189 | type == EFstrType::PredictionValuesChange || type == EFstrType::InternalFeatureImportance, |
| 190 | "Inappropriate fstr type " << type); |
| 191 | return CalcFeatureEffectAverageChange(model, dataset, localExecutor); |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | TVector<TFeatureEffect> CalcRegularFeatureEffect( |
| 196 | const TVector<std::pair<double, TFeature>>& internalEffect, |
no test coverage detected