| 233 | } |
| 234 | |
| 235 | int testKNNValidatorLinearIndex() { |
| 236 | |
| 237 | Specification::Model m1; |
| 238 | |
| 239 | KNNValidatorTests::generateInterface(m1); |
| 240 | |
| 241 | auto *knnClassifier = m1.mutable_knearestneighborsclassifier(); |
| 242 | KNNValidatorTests::setNumberOfNeighbors(knnClassifier, 3, true); |
| 243 | knnClassifier->mutable_uniformweighting(); |
| 244 | |
| 245 | auto *nnIndex = knnClassifier->mutable_nearestneighborsindex(); |
| 246 | nnIndex->mutable_linearindex(); |
| 247 | nnIndex->mutable_squaredeuclideandistance(); |
| 248 | |
| 249 | KNNValidatorTests::addDataPoints(knnClassifier); |
| 250 | KNNValidatorTests::addStringLabels(knnClassifier); |
| 251 | |
| 252 | Result res = validate<MLModelType_kNearestNeighborsClassifier>(m1); |
| 253 | ML_ASSERT_GOOD(res); |
| 254 | |
| 255 | return 0; |
| 256 | |
| 257 | } |
| 258 | |
| 259 | int testKNNValidatorSingleKdTreeIndex() { |
| 260 |
nothing calls this directly
no test coverage detected