public class CosineDistanceMatrix extends Object
| Constructor and Description |
|---|
CosineDistanceMatrix(HashMap<String,HashMap<String,Double>> tfidf)
Builds a distance matrix.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distanceBetween(String keyA,
String keyB)
get the distance value between two keys.
|
double[][] |
getDistances()
Get the distances as matrix.
|
String[] |
getRows()
Get all the row names - i.e.
|
String |
toString()
Prints matrix.
|
void |
transformForHC()
This will subtract all distance values from 1 - so distance becomes inversed - good for
clustering.
|
public String[] getRows()
public double[][] getDistances()
public double distanceBetween(String keyA, String keyB)
keyA - first key.keyB - second key.public void transformForHC()
Copyright © 2021. All rights reserved.