weka.classifiers.neural.lvq.vectordistance
Class DistanceFactory

java.lang.Object
  extended by weka.classifiers.neural.lvq.vectordistance.DistanceFactory

public class DistanceFactory
extends java.lang.Object

Description: Responsible for evaluating each attribute in the provided data instance, and returning an ordered list of distance measures used to calculate the distance for each attribute in the data item.
Copyright (c) Jason Brownlee 2004

Author:
Jason Brownlee

Constructor Summary
DistanceFactory()
           
 
Method Summary
static double calculateDistance(AttributeDistance[] distances, double[] instance, double[] vector, double aBestValue)
          Calculates the distances between the provided vectors, using the distance measures provided.
static AttributeDistance[] getAttributeDistanceList(weka.core.Instances instances)
          Returns a vector of the same length as the data instance, where each element matches a data attribute at the same index in the data instance, and provides a suitable distance measure used for calculating the dinstanec between two values of the attributes type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceFactory

public DistanceFactory()
Method Detail

getAttributeDistanceList

public static AttributeDistance[] getAttributeDistanceList(weka.core.Instances instances)
Returns a vector of the same length as the data instance, where each element matches a data attribute at the same index in the data instance, and provides a suitable distance measure used for calculating the dinstanec between two values of the attributes type. If the attribute is unknown, then a distance of OtherDistance is assigned.

Parameters:
instances -
Returns:

calculateDistance

public static final double calculateDistance(AttributeDistance[] distances,
                                             double[] instance,
                                             double[] vector,
                                             double aBestValue)
Calculates the distances between the provided vectors, using the distance measures provided.

Parameters:
distances -
instance -
vector -
Returns: