| 158 | } |
| 159 | |
| 160 | void TTargetsStatistics::Init(const TDataMetaInfo& metaInfo, const TFeatureCustomBorders& customBorders) { |
| 161 | TargetType = metaInfo.TargetType; |
| 162 | TargetCount = metaInfo.TargetCount; |
| 163 | switch (TargetType) { |
| 164 | case ERawTargetType::Float: |
| 165 | FloatTargetStatistics.resize(TargetCount); |
| 166 | break; |
| 167 | case ERawTargetType::Boolean: |
| 168 | case ERawTargetType::Integer: |
| 169 | case ERawTargetType::String: |
| 170 | DiscreteTargetStatistics.resize(TargetCount); |
| 171 | for (ui32 i = 0; i < TargetCount; ++i) { |
| 172 | DiscreteTargetStatistics[i].TargetType = TargetType; |
| 173 | } |
| 174 | break; |
| 175 | default: |
| 176 | CB_ENSURE(TargetType == ERawTargetType::None, "Unexpected target type " << TargetType << ", expected 'None'"); |
| 177 | CATBOOST_DEBUG_LOG << "No target was found for Target statistics\n"; |
| 178 | break; |
| 179 | } |
| 180 | SetCustomBorders(customBorders, &FloatTargetStatistics); |
| 181 | } |
| 182 | |
| 183 | void TTargetsStatistics::Update(ui32 flatTargetIdx, TStringBuf value) { |
| 184 | DiscreteTargetStatistics[flatTargetIdx].Update(value); |
no test coverage detected