C# Class SharpNeat.DistanceMetrics.DistanceMetricUtils

Static helper methods for distance metrics.
Mostra file Open project: colgreen/sharpneat

Public Methods

Method Description
CalculateCentroid ( IDistanceMetric distanceMetric, IList coordList ) : CoordinateVector

Calculates a centroid by comparing each coordinate with every other coordinate. The coord with the lowest average distance from all other coords is the most central coord (the centroid). This method uses an inefficient N*N comparison of coords to find a centroid. It is provided only as a last resort for distance metrics for which no means exist to calculate a centroid more directly.

Private Methods

Method Description
CalculateMeanDistanceFromCoords ( IDistanceMetric distanceMetric, IList coordList, int idx ) : double

Calculate the mean distance of the specified coord from all of the other coords using the provided distance metric.

Method Details

CalculateCentroid() public static method

Calculates a centroid by comparing each coordinate with every other coordinate. The coord with the lowest average distance from all other coords is the most central coord (the centroid). This method uses an inefficient N*N comparison of coords to find a centroid. It is provided only as a last resort for distance metrics for which no means exist to calculate a centroid more directly.
public static CalculateCentroid ( IDistanceMetric distanceMetric, IList coordList ) : CoordinateVector
distanceMetric IDistanceMetric
coordList IList
return SharpNeat.Core.CoordinateVector