Struct WeightedEuclidean
Weighted Euclidean distance metric.
Implements
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 SourceWeightedEuclidean(Double[])
Initializes a new instance of the WeightedEuclidean struct.
Declaration
public WeightedEuclidean(double[] weights)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Double[] | weights | The weights.  | 
      
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 SourceWeights
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 SourceClone()
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.  | 
      
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   | 
      
| System.Double[] | y | The second point   | 
      
Returns
| Type | Description | 
|---|---|
| System.Double | A double-precision value representing the distance   | 
      
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.  |