def validate_float_samples(self, spec, expected):
        """Validate the float samples returned from the converted scikit KNeighborsClassifier"""
        num_dimensions = (
            spec.kNearestNeighborsClassifier.nearestNeighborsIndex.numberOfDimensions
        )
        for index, sample in enumerate(
            spec.kNearestNeighborsClassifier.nearestNeighborsIndex.floatSamples
        ):
            for dim in range(0, num_dimensions):
                self.assertAlmostEqual(
                    sample.vector[dim], expected[index][dim], places=6
                )
Validate the float samples returned from the converted scikit KNeighborsClassifier
coremltools/test/sklearn_tests/test_k_neighbors_classifier.py