mlx_graphs.datasets.MovieLens100K#
- class mlx_graphs.datasets.MovieLens100K(base_dir: str, transform: Callable | None = None, pre_transform: Callable | None = None)[source]#
The MovieLens 100K heterogeneous rating dataset, assembled by GroupLens Research from the MovieLens web site, consisting of movies (1,682 nodes) and users (943 nodes) with 100K ratings between them. User ratings for movies are available as ground truth labels. Features of users and movies are encoded according to the “Inductive Matrix Completion Based on Graph Neural Networks” paper.
- Parameters:
base_dir (str) – Directory where to store dataset files.
transform (callable, optional) – A function/transform that takes in an
HeteroGraphDataobject and returns a transformed version. The data object will be transformed before every access. (default:None)pre_transform (callable, optional) – A function/transform that takes in an HeteroGraphData object and returns a transformed version. The data object will be transformed before being saved to disk. (default:
None)
- __init__(base_dir: str, transform: Callable | None = None, pre_transform: Callable | None = None)[source]#
Methods
__init__(base_dir[, transform, pre_transform])download()Download the dataset at self.raw_path.
load()Load the processed dataset
process()Process the dataset and store data in self.data
save()Save the processed dataset
Attributes
file_idnameName of the dataset
num_edge_classesReturns a dictionary of the number of edge classes for each edge type.
num_edge_featuresReturns a dictionary of the number of edge features for each edge type.
num_edgesReturns a dictionary of the number of edges for each edge type.
num_graph_featuresReturns the number of graph features.
num_itemsReturns the number of items in the dataset.
num_node_classesReturns a dictionary of the number of node classes for each node type.
num_node_featuresReturns a dictionary of the number of node features for each node type.
num_nodesReturns a dictionary of the number of nodes for each node type.
processed_pathThe path where processed files are stored.
raw_file_namesThe path where raw files are stored.