| 296 | } |
| 297 | |
| 298 | TFeature GetFeature(const TFullModel& model, const TModelSplit& split) { |
| 299 | TFeature result; |
| 300 | result.Type = split.Type; |
| 301 | switch(result.Type) { |
| 302 | case ESplitType::FloatFeature: |
| 303 | result.FeatureIdx = split.FloatFeature.FloatFeature; |
| 304 | break; |
| 305 | case ESplitType::OneHotFeature: |
| 306 | result.FeatureIdx = split.OneHotFeature.CatFeatureIdx; |
| 307 | break; |
| 308 | case ESplitType::OnlineCtr: |
| 309 | result.Ctr = split.OnlineCtr.Ctr; |
| 310 | break; |
| 311 | case ESplitType::EstimatedFeature: |
| 312 | result.EstimatedFeature = TModelEstimatedFeature{ |
| 313 | split.EstimatedFeature.ModelEstimatedFeature.SourceFeatureId, |
| 314 | split.EstimatedFeature.ModelEstimatedFeature.CalcerId, |
| 315 | split.EstimatedFeature.ModelEstimatedFeature.LocalId, |
| 316 | split.EstimatedFeature.ModelEstimatedFeature.SourceFeatureType |
| 317 | }; |
| 318 | result.FeatureCalcerType = GetEstimatedFeatureCalcerType( |
| 319 | model, |
| 320 | split.EstimatedFeature.ModelEstimatedFeature |
| 321 | ); |
| 322 | result.FeatureIdx = split.EstimatedFeature.ModelEstimatedFeature.SourceFeatureId; |
| 323 | break; |
| 324 | default: |
| 325 | CB_ENSURE(false, "Unsupported split type " << result.Type); |
| 326 | } |
| 327 | return result; |
| 328 | } |
no test coverage detected