Exemple #1
0
            public IVector CalculateDistance(IVector vector, DistanceMetric distanceMetric)
            {
                if (_curr == null)
                {
                    _curr = _centroid.Select(c => c.Current).ToArray();
                }

                if (distanceMetric == DistanceMetric.Cosine)
                {
                    return(vector.CosineDistance(_curr, ref _clusterNorm));
                }
                else
                {
                    return(vector.FindDistances(_curr, distanceMetric));
                }
            }