private double [ ] get1ToNDistances ( Instance sample , Instances samples ) { double distances [ ] = new double [ samples . numInstances ( ) ] ; for ( int i = 0 ; i < samples . numInstances ( ) ; i ++ ) { distances [ i ] = this . getDistance ( sample , samples . get ( i ) ) ; } return distances ; }
Returns the Euclidean distance between one sample and a collection of samples in an 1D - array .