|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.core.NormalizableDistance
weka.core.MinkowskiDistance
public class MinkowskiDistance
Implementing Minkowski distance (or similarity) function.
One object defines not one distance but the data model in which the distances between objects of that data model can be computed.
Attention: For efficiency reasons the use of consistency checks (like are the data models of the two instances exactly the same), is low.
For more information, see:
Wikipedia. Minkowski distance. URL http://en.wikipedia.org/wiki/Minkowski_distance.
@misc{missing_id,
author = {Wikipedia},
title = {Minkowski distance},
URL = {http://en.wikipedia.org/wiki/Minkowski_distance}
}
Valid options are:
-P <order> The order 'p'. With '1' being the Manhattan distance and '2' the Euclidean distance. (default: 2)
-D Turns off the normalization of attribute values in distance calculation.
-R <col1,col2-col4,...> Specifies list of columns to used in the calculation of the distance. 'first' and 'last' are valid indices. (default: first-last)
-V Invert matching sense of column indices.
| Field Summary |
|---|
| Fields inherited from class weka.core.NormalizableDistance |
|---|
R_MAX, R_MIN, R_WIDTH |
| Constructor Summary | |
|---|---|
MinkowskiDistance()
Constructs an Minkowski Distance object, Instances must be still set. |
|
MinkowskiDistance(Instances data)
Constructs an Minkowski Distance object and automatically initializes the ranges. |
|
| Method Summary | |
|---|---|
double |
distance(Instance first,
Instance second)
Calculates the distance between two instances. |
double |
distance(Instance first,
Instance second,
PerformanceStats stats)
Calculates the distance (or similarity) between two instances. |
double |
getOrder()
Gets the order. |
String |
getRevision()
Returns the revision string. |
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on. |
String |
globalInfo()
Returns a string describing this object. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
String |
orderTipText()
Returns the tip text for this property. |
void |
postProcessDistances(double[] distances)
Does post processing of the distances (if necessary) returned by distance(distance(Instance first, Instance second, double cutOffValue). |
void |
setOrder(double value)
Sets the order. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MinkowskiDistance()
public MinkowskiDistance(Instances data)
data - the instances the distance function should work on| Method Detail |
|---|
public String globalInfo()
globalInfo in class NormalizableDistancepublic TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class NormalizableDistancepublic String orderTipText()
public void setOrder(double value)
value - the new orderpublic double getOrder()
public double distance(Instance first,
Instance second)
distance in interface DistanceFunctiondistance in class NormalizableDistancefirst - the first instancesecond - the second instance
public double distance(Instance first,
Instance second,
PerformanceStats stats)
distance in interface DistanceFunctiondistance in class NormalizableDistancefirst - the first instancesecond - the second instancestats - the structure for storing performance statistics.
public void postProcessDistances(double[] distances)
postProcessDistances in interface DistanceFunctionpostProcessDistances in class NormalizableDistancedistances - the distances to post-processpublic String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||