framework icon indicating copy to clipboard operation
framework copied to clipboard

KNearestNeighbors.Scores(double[],double[]) throws IndexOutOfRangeException

Open kevdever opened this issue 8 years ago • 0 comments

What would you like to submit? (put an 'x' inside the bracket that applies)

  • [ ] question
  • [x ] bug report
  • [ ] feature request

Issue description KNearestNeighbors.Scores(double[],double[]) throws IndexOutOfRangeException when called via Decide(double[][]) and GeneralConfusionMatrix.Estimate(KNN, double[][], int[])

I've confirmed that none of the arrays I'm feeding in contain any nulls, and that they're all of matching dimensions.

I'm able to call Learn without issue. I get the exception whether I pass in the training set or a test set.

            var knn = new KNearestNeighbors(k);
            var (xTrain, xTest, yTrain, yTest) = SplitIntoTestAndTraining(inputFeatures, outputs, 0.20d);
            knn.Learn(xTrain, yTrain);
            var d = knn.Decide(xTest);
            var diagnostics = GeneralConfusionMatrix.Estimate(knn, xTest, yTest);
            return new TrainedKNN(_scaler.ScalerBounds, knn, default, k);``

call stack: image

exception detail: image

I can reproduce this problem in 3.7.0, 3.8.0, and 3.8.2-alpha.

kevdever avatar Apr 09 '18 04:04 kevdever