Package Utils.Correlation
Class Correlation
- java.lang.Object
-
- Utils.Correlation.Correlation
-
-
Constructor Summary
Constructors Constructor Description Correlation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description double[][]
calculate(byte[][] data)
Calculates correlations between all pairs of arraysabstract double
calculate(byte[] d1, byte[] d2)
Calculates the correlation between two arraysjava.util.Map<java.lang.Integer,int[]>
limitedtopn(byte[][] data, int n, java.util.Set<java.lang.Integer> list)
Similar to topn except it only considers the given arraysjava.util.Map<java.lang.Integer,double[]>
limitedtopnvalues(byte[][] data, int n, java.util.Set<java.lang.Integer> list)
Similar to limitedtopn except it returns correlationsjava.util.Map<java.lang.Integer,int[]>
topn(byte[][] data, int n)
Returns the position of the most correlated arrays for every array.java.util.Map<java.lang.Integer,double[]>
topnvalues(byte[][] data, int n)
Similar to topn except it returns the correlations rather than the positions
-
-
-
Method Detail
-
calculate
public double[][] calculate(byte[][] data)
Calculates correlations between all pairs of arrays- Parameters:
data
- The data- Returns:
- A symmetric array of correlations
-
topn
public java.util.Map<java.lang.Integer,int[]> topn(byte[][] data, int n)
Returns the position of the most correlated arrays for every array. The n most correlated arrays are returned- Parameters:
data
- The datan
- Return this number of top correlated arrays- Returns:
- Map from the position of an array to the position of the n arrays most correlated with it
-
topnvalues
public java.util.Map<java.lang.Integer,double[]> topnvalues(byte[][] data, int n)
Similar to topn except it returns the correlations rather than the positions- Parameters:
data
- The datan
- Return this number of top correlated arrays- Returns:
- Map from the position of an array to the correlation of the n arrays most correlated with it
-
limitedtopn
public java.util.Map<java.lang.Integer,int[]> limitedtopn(byte[][] data, int n, java.util.Set<java.lang.Integer> list)
Similar to topn except it only considers the given arrays- Parameters:
data
- The datan
- Return this number of top correlated arrayslist
- The position of the arrays to consider- Returns:
- Map from the position of an array to the position of the n arrays in the list most correlated with it
-
limitedtopnvalues
public java.util.Map<java.lang.Integer,double[]> limitedtopnvalues(byte[][] data, int n, java.util.Set<java.lang.Integer> list)
Similar to limitedtopn except it returns correlations- Parameters:
data
- The datan
- Return this number of top correlated arrayslist
- The position of the arrays to consider- Returns:
- Map from the position of an array to the correlation of the n arrays in the list most correlated with it
-
calculate
public abstract double calculate(byte[] d1, byte[] d2)
Calculates the correlation between two arrays- Parameters:
d1
- The first arrayd2
- The second array- Returns:
- The correlation
-
-