making conformance score more robust #16
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
added:
The previous implementation took for the computation of the score value the minimum of the k-nearest neighbours = the 1-nearest neighbour, aka the parameter k had no influence except for the thresholding. This lead in some cases to anomalous behaviour if the corpus had some variance among itself.
The previous implementation could lead to such cases:
Where, notably, the outliers are to the left of the inliers (inliers = generated from same distribution as the corpus). The dataset is here quiet complicated and we do not expect the algorithm to be able to distinguish between inliers and type-2-outliers; but at the very least, the type-2-outliers should not be closer to the corpus than the inliers (in fact, type-2-outliers are generated from a higher variance distribution than the corpus) . However, as evident in this first plot, the type-2-outliers are closer (lower conformance score) than the inliers.
Using the newly proposed median feature for k=10 nearest neighbours, this issue gets fixed: