MCPcopy Create free account
hub / github.com/apple/coremltools / testKNNValidatorNoLabels

Function testKNNValidatorNoLabels

mlmodel/tests/KNNValidatorTests.cpp:178–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178int testKNNValidatorNoLabels() {
179
180 Specification::Model m1;
181
182 KNNValidatorTests::generateInterface(m1);
183
184 auto *nnModel = m1.mutable_knearestneighborsclassifier();
185 KNNValidatorTests::setNumberOfNeighbors(nnModel, 3, true);
186
187 KNNValidatorTests::addDataPoints(nnModel);
188
189 Result res = validate<MLModelType_kNearestNeighborsClassifier>(m1);
190 ML_ASSERT_BAD(res);
191
192 return 0;
193
194}
195
196int testKNNValidatorWrongNumberOfLabels() {
197

Callers

nothing calls this directly

Calls 3

generateInterfaceFunction · 0.85
setNumberOfNeighborsFunction · 0.85
addDataPointsFunction · 0.85

Tested by

no test coverage detected