| 314 | } |
| 315 | |
| 316 | int testKNNValidatorNoDistanceFunction() { |
| 317 | |
| 318 | Specification::Model m1; |
| 319 | |
| 320 | KNNValidatorTests::generateInterface(m1); |
| 321 | |
| 322 | auto *knnClassifier = m1.mutable_knearestneighborsclassifier(); |
| 323 | KNNValidatorTests::setNumberOfNeighbors(knnClassifier, 3, true); |
| 324 | knnClassifier->mutable_uniformweighting(); |
| 325 | |
| 326 | auto *nnIndex = knnClassifier->mutable_nearestneighborsindex(); |
| 327 | nnIndex->mutable_linearindex(); |
| 328 | |
| 329 | KNNValidatorTests::addDataPoints(knnClassifier); |
| 330 | KNNValidatorTests::addStringLabels(knnClassifier); |
| 331 | |
| 332 | Result res = validate<MLModelType_kNearestNeighborsClassifier>(m1); |
| 333 | ML_ASSERT_BAD(res); |
| 334 | |
| 335 | return 0; |
| 336 | |
| 337 | } |
| 338 | |
| 339 | int testKNNValidatorGood() { |
| 340 |
nothing calls this directly
no test coverage detected