Generated by DocFX

Struct WeightedEuclidean

Weighted Euclidean distance metric.

Implements
IMetric<System.Double[]>
IDistance<System.Double[]>
IDistance<System.Double[], System.Double[]>
ISimilarity<System.Double[]>
ISimilarity<System.Double[], System.Double[]>
ICloneable
Namespace: ISynergy.Framework.Mathematics.Distances
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public struct WeightedEuclidean : IMetric<double[]>, IDistance<double[]>, IDistance<double[], double[]>, ISimilarity<double[]>, ISimilarity<double[], double[]>

Constructors

View Source

WeightedEuclidean(Double[])

Initializes a new instance of the WeightedEuclidean struct.

Declaration
public WeightedEuclidean(double[] weights)
Parameters
Type Name Description
System.Double[] weights

The weights.

View Source

WeightedEuclidean(Int32)

Initializes a new instance of the WeightedEuclidean struct.

Declaration
public WeightedEuclidean(int dimensions)
Parameters
Type Name Description
System.Int32 dimensions

The number of dimensions (columns) in the dataset.

Properties

View Source

Weights

Gets or sets the weights for each dimension. Default is a vector of ones.

Declaration
public double[] Weights { get; set; }
Property Value
Type Description
System.Double[]

The weights.

Methods

View Source

Clone()

Creates a new object that is a copy of the current instance.

Declaration
public object Clone()
Returns
Type Description
System.Object

A new object that is a copy of this instance.

View Source

Distance(Double[], Double[])

Computes the distance d(x,y) between points x and y.

Declaration
public double Distance(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x

The first point x.

System.Double[] y

The second point y.

Returns
Type Description
System.Double

A double-precision value representing the distance d(x,y) between x and y according to the distance function implemented by this class.

View Source

Similarity(Double[], Double[])

Gets a similarity measure between two points.

Declaration
public double Similarity(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x

The first point to be compared.

System.Double[] y

The second point to be compared.

Returns
Type Description
System.Double

A similarity measure between x and y.

Implements

IMetric<T>
IDistance<T>
IDistance<T, U>
ISimilarity<T>
ISimilarity<T, U>
ICloneable

Extension Methods

EnumExtensions.GetSymbol<T>(T)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.AddressOf<T>(T)
ObjectExtensions.ToByteArray<T>(T)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)

See Also

Euclidean
SquareEuclidean
WeightedSquareEuclidean