C# Class MyMediaLite.Correlation.BinaryCosine

Class for storing cosine similarities
http://en.wikipedia.org/wiki/Cosine_similarity
Inheritance: BinaryDataCorrelationMatrix
Datei anzeigen Open project: zenogantner/MML-KDD Class Usage Examples

Public Methods

Method Description
BinaryCosine ( CorrelationMatrix correlation_matrix ) : System

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

BinaryCosine ( int num_entities ) : System

Creates an object of type Cosine

ComputeCorrelation ( HashSet vector_i, HashSet vector_j ) : float

Computes the cosine similarity of two binary vectors

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

Creates a Cosine similarity matrix from given data

Method Details

BinaryCosine() public method

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

BinaryCosine() public method

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

ComputeCorrelation() public static method

Computes the cosine similarity 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 Cosine similarity matrix from given data
public static Create ( IBooleanMatrix vectors ) : CorrelationMatrix
vectors IBooleanMatrix the boolean data
return CorrelationMatrix