(self, dataset, split_ratio=None, neg_ratio=3, **kwargs)
| 271 | """ |
| 272 | |
| 273 | def __init__(self, dataset, split_ratio=None, neg_ratio=3, **kwargs): |
| 274 | self.g = dataset[0] |
| 275 | self.num_nodes = self.g.num_nodes() |
| 276 | self.dataset = dataset |
| 277 | self.split_ratio = split_ratio |
| 278 | self.neg_ratio = neg_ratio |
| 279 | super().__init__( |
| 280 | dataset.name + "-as-linkpred", |
| 281 | hash_key=(neg_ratio, split_ratio, dataset.name, "linkpred"), |
| 282 | **kwargs |
| 283 | ) |
| 284 | |
| 285 | def process(self): |
| 286 | if self.split_ratio is None: |