build/modelscript.umd.js
function distanceFrom(Centroids) {
                var distances = [];

                for(var i = 1; i <= this.Observations.rows(); i++) {
                    var distance = [];

                    for(var j = 1; j <= Centroids.rows(); j++) {
                        distance.push(this.Observations.row(i).distanceFrom(Centroids.row(j)));
                    }

                    distances.push(distance);
                }

                return $M(distances);
            }
function distanceFrom(Centroids) {
                var distances = [];

                for(var i = 1; i <= this.Observations.rows(); i++) {
                    var distance = [];

                    for(var j = 1; j <= Centroids.rows(); j++) {
                        distance.push(this.Observations.row(i).distanceFrom(Centroids.row(j)));
                    }

                    distances.push(distance);
                }

                return $M(distances);
            }
function distanceFrom ( Centroids ) { var distances = [ ] ; for ( var i = 1 ; i <= this . Observations . rows ( ) ; i ++ ) { var distance = [ ] ; for ( var j = 1 ; j <= Centroids . rows ( ) ; j ++ ) { distance . push ( this . Observations . row ( i ) . distanceFrom ( Centroids . row ( j ) ) ) ; } distances . push ( distance ) ; } return $M ( distances ) ; }
get the euclidian distance between the feature data X and a given centroid matrix C.
get the euclidian distance between the feature data X and a given centroid matrix C .