Relation files
Relation files describe binary relations over one type of entity, e.g. over users or over items. An example for a user relation is the edges in the social network. An example for an item relation would be the relation "A is a sequel to B" for movies.
Please note that relations are not automatically symmetric. This means that "1,2" does not imply "2,1". If you want to have a symmetric relation, make sure that both lines are contained in the file.
Relation files have exactly two columns. Each column contains an entity ID. One line in a file means there exists a relation between the first and the second entity mentioned in that line.Examples
Tab-separated columns (.tsv)
51 5 51 22 51 26 51 29 51 35 51 36 51 45This means that the entity 51 (may be a user or item) is in relation with the entities 5, 22, 26, ... of the same type If this example is complete, it also means entity 51 does not have a relation with entities 0, 1, 2, 3, 4, 6, ...
Space-separated columns
51 5 51 22 51 26 51 29 51 35 51 36 51 45
Comma-separated columns (.csv)
51,5 51,22 51,26 51,29 51,35 51,36 51,45
Command-line tools
Both the item recommendation tool and the rating prediction tool support this file format.
Classes
Reading
The class for reading in this kind of file is
MyMediaLite.IO.RelationData
.