torch_geometric.datasets.MovieLens
- class MovieLens(root: str, transform: Optional[Callable] = None, pre_transform: Optional[Callable] = None, model_name: Optional[str] = 'all-MiniLM-L6-v2', force_reload: bool = False)[source]
Bases:
InMemoryDataset
A heterogeneous rating dataset, assembled by GroupLens Research from the MovieLens web site, consisting of nodes of type
"movie"
and"user"
. User ratings for movies are available as ground truth labels for the edges between the users and the movies("user", "rates", "movie")
.- Parameters:
root (str) – Root directory where the dataset should be saved.
transform (callable, optional) – A function/transform that takes in an
torch_geometric.data.HeteroData
object 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
torch_geometric.data.HeteroData
object and returns a transformed version. The data object will be transformed before being saved to disk. (default:None
)model_name (str) – Name of model used to transform movie titles to node features. The model comes from the`Huggingface SentenceTransformer <https://huggingface.co/sentence-transformers>`_.
force_reload (bool, optional) – Whether to re-process the dataset. (default:
False
)