List<VectorDistanceTuple<DoubleVector>> neighbours = new ArrayList<>();
List<DistanceResult<DoubleVector>> result = index.query(feature, k,
Double.MAX_VALUE);
// now we need to join the features with its outcome
for (DistanceResult<DoubleVector> res : result) {
KeyedDoubleVector resValue = (KeyedDoubleVector) res.get();
neighbours.add(new VectorDistanceTuple<>(res.get(), featureOutcomeMap
.get(resValue.getKey()), res.getDistance()));
}
return neighbours;
}