|
MyMediaLite
3.11
|
Extension methods for correlation matrices More...
Static Public Member Functions | |
| static IList< int > | GetNearestNeighbors (this ICorrelationMatrix c, int entity_id, uint k) |
| Get the k nearest neighbors of a given entity More... | |
| static IList< int > | GetPositivelyCorrelatedEntities (this ICorrelationMatrix c, int entity_id) |
| Get all entities that are positively correlated to an entity, sorted by correlation More... | |
| static void | ReadAsymmetricCorrelationMatrix (this AsymmetricCorrelationMatrix correlation, StreamReader reader) |
| Reads a AsymmetricCorrelationMatrix from the lines of a StreamReader More... | |
| static void | ReadSymmetricCorrelationMatrix (this SymmetricCorrelationMatrix correlation, StreamReader reader) |
| Reads a SymmetricCorrelationMatrix from the lines of a StreamReader More... | |
| static void | SetZero (this ICorrelationMatrix c) |
| Sets all values in a matrix to zero More... | |
| static double | SumUp (this ICorrelationMatrix correlation, int entity_id, ICollection< int > entities, float q=1.0f) |
| Sum up the correlations between a given entity and the entities in a collection More... | |
Extension methods for correlation matrices
|
inlinestatic |
Get the k nearest neighbors of a given entity
| c | a correlation matrix |
| entity_id | the numerical ID of the entity |
| k | the neighborhood size |
|
inlinestatic |
Get all entities that are positively correlated to an entity, sorted by correlation
| c | a correlation matrix |
| entity_id | the entity ID |
|
inlinestatic |
Reads a AsymmetricCorrelationMatrix from the lines of a StreamReader
In the first line, we expect to be the number of entities. All the other lines have the format
EntityID1 EntityID2 Correlation
where EntityID1 and EntityID2 are non-negative integers and Correlation is a floating point number.
| correlation | a correlation matrix |
| reader | the StreamReader to read from |
|
inlinestatic |
Reads a SymmetricCorrelationMatrix from the lines of a StreamReader
In the first line, we expect to be the number of entities. All the other lines have the format
EntityID1 EntityID2 Correlation
where EntityID1 and EntityID2 are non-negative integers and Correlation is a floating point number.
| correlation | a correlation matrix |
| reader | the StreamReader to read from |
|
inlinestatic |
Sets all values in a matrix to zero
| c | a correlation matrix |
|
inlinestatic |
Sum up the correlations between a given entity and the entities in a collection
| correlation | the correlation matrix |
| entity_id | the numerical ID of the entity |
| entities | a collection containing the numerical IDs of the entities to compare to |
| q | score exponent |
1.8.9.1