C# Class MyMediaLite.Correlation.Jaccard

Class for storing and computing the Jaccard index (Tanimoto coefficient)
The Jaccard index is often also called the Tanimoto coefficient. http://en.wikipedia.org/wiki/Jaccard_index
Inheritance: MyMediaLite.Correlation.BinaryDataSymmetricCorrelationMatrix
Show file Open project: zenogantner/MML-KDD Class Usage Examples

Public Methods

Method Description
ComputeCorrelation ( HashSet vector_i, HashSet vector_j ) : float

Computes the Jaccard index of two binary vectors

ComputeCorrelations ( IBooleanMatrix entity_data ) : void
Create ( IBooleanMatrix vectors ) : CorrelationMatrix

Creates a Jaccard index matrix from given data

Jaccard ( CorrelationMatrix correlation_matrix ) : System

Copy constructor. Creates an object of type Jaccard from an existing correlation matrix

Jaccard ( int num_entities ) : System

Creates an object of type Jaccard

Method Details

ComputeCorrelation() public static method

Computes the Jaccard index of two binary vectors
public static ComputeCorrelation ( HashSet vector_i, HashSet vector_j ) : float
vector_i HashSet the first vector
vector_j HashSet the second vector
return float

ComputeCorrelations() public method

public ComputeCorrelations ( IBooleanMatrix entity_data ) : void
entity_data IBooleanMatrix
return void

Create() public static method

Creates a Jaccard index matrix from given data
public static Create ( IBooleanMatrix vectors ) : CorrelationMatrix
vectors IBooleanMatrix the boolean data
return CorrelationMatrix

Jaccard() public method

Copy constructor. Creates an object of type Jaccard from an existing correlation matrix
public Jaccard ( CorrelationMatrix correlation_matrix ) : System
correlation_matrix CorrelationMatrix the correlation matrix to copy
return System

Jaccard() public method

Creates an object of type Jaccard
public Jaccard ( int num_entities ) : System
num_entities int the number of entities
return System