moj.similarity.measures
Class CosineD_row
java.lang.Object
moj.similarity.SimilarityMeasure
moj.similarity.measures.CosineD_row
public class CosineD_row
- extends SimilarityMeasure
COSINE DISTANCE MEASURE
Originally written by P. Cejchan, 1999/08/13. Algorithm taken from:
Carbonell, J.G.& al. 1997 "Translingual Information Retrieval: A comparative
evaluation. IJCAI'97". See also Salton, G. 1989 "Automatic text processing:
The transformation, Analysis, and retrieval of information by computer".
Addison-Wesley, Reading, Pennsylvania. (Jongman, et. al., 1995, page
178)--"More emphasis is given to qualitative aspects by not considering a
site as point but as a vector. Understandably, the direction of this vector
tells us something about the relative abundances of species. The similarity
of two sites can be expressed as some function of the angle between the
vector of these sites. Quite common is the use of the cosine (or Ochiai
coefficient):
cos=OS=sigma(k)Y(ki)Y(kj)/sqrt{[sigma(k)(Y(ki)^2)][sigma(k)(Y(kj))^2)]}"
<-- this is obviously for distance between columns, not rows (P.C).
- Version:
- 2004-Sep-03
- Author:
- Martin Hassel
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CosineD_row
public CosineD_row()
analyzeMatrix
public double[][] analyzeMatrix(float[][] data_matrix)
- Specified by:
analyzeMatrix
in class SimilarityMeasure
- Parameters:
data_matrix
- an array of float
arrays denoting the
rows in the matrix that are to be compared for similarity.
- Returns:
- an array of
double
arrays containing the
similarities between all rows