| 184 | } |
| 185 | |
| 186 | TFullModel SimpleFloatModel(size_t treeCount) { |
| 187 | TFullModel model; |
| 188 | TModelTrees* trees = model.ModelTrees.GetMutable(); |
| 189 | trees->SetFloatFeatures( |
| 190 | { |
| 191 | TFloatFeature{ |
| 192 | false, 0, 0, |
| 193 | {}, // bin splits 0, 1 |
| 194 | "" |
| 195 | }, |
| 196 | TFloatFeature{ |
| 197 | false, 1, 1, |
| 198 | {0.5f}, // bin split 2 |
| 199 | "" |
| 200 | }, |
| 201 | TFloatFeature{ |
| 202 | false, 2, 2, |
| 203 | {0.5f}, // bin split 3 |
| 204 | "" |
| 205 | } |
| 206 | } |
| 207 | ); |
| 208 | for (auto i : xrange(301)) { |
| 209 | trees->AddFloatFeatureBorder(0, -298.0f + i); |
| 210 | } |
| 211 | { |
| 212 | double tenPower = 1.0; |
| 213 | for (size_t treeIndex = 0; treeIndex < treeCount; ++treeIndex) { |
| 214 | TVector<int> tree = {300, 301, 302}; |
| 215 | trees->AddBinTree(tree); |
| 216 | for (int leafIndex = 0; leafIndex < 8; ++leafIndex) { |
| 217 | trees->AddLeafValue(leafIndex * tenPower); |
| 218 | } |
| 219 | tenPower *= 10.0; |
| 220 | } |
| 221 | } |
| 222 | model.UpdateDynamicData(); |
| 223 | return model; |
| 224 | } |
| 225 | |
| 226 | TFullModel SimpleTextModel( |
| 227 | TIntrusivePtr<TTextProcessingCollection> textCollection, |
no test coverage detected