Repository: pyg-team/pytorch_geometric

Issue:
Classification metrics can't handle a mix of binary and continuous targets
### 🐛 Describe the bug

I was trying to run the [pytorch_geometric](https://github.com/pyg-team/pytorch_geometric)/[examples](https://github.com/pyg-team/pytorch_geometric/tree/master/examples)/[hetero](https://github.com/pyg-team/pytorch_geometric/tree/master/examples/hetero)/bipartite_sage_unsup.py . I received the following error in the training loop. The error happened after the test() function was called

## Error
```
ValueError                                Traceback (most recent call last)
[<ipython-input-7-449d394a8262>](https://localhost:8080/#) in <module>
     54 for epoch in range(1, 21):
     55     loss = train()
---> 56     val_acc, val_prec, val_rec, val_f1 = test(val_loader)
     57     test_acc, test_prec, test_rec, test_f1 = test(test_loader)
     58 

3 frames
[/usr/local/lib/python3.8/dist-packages/sklearn/metrics/_classification.py](https://localhost:8080/#) in _check_targets(y_true, y_pred)
     91 
     92     if len(y_type) > 1:
---> 93         raise ValueError(
     94             "Classification metrics can't handle a mix of {0} and {1} targets".format(
     95                 type_true, type_pred

ValueError: Classification metrics can't handle a mix of binary and continuous targets
```
## Code modifications
```
@torch.no_grad()
def test(loader):
    model.eval()

    preds, targets = [], []
    for batch in tqdm.tqdm(loader):
        batch = batch.to(device)

        pred = model(
            batch.x_dict,
            batch.edge_index_dict,
            batch['user', 'item'].edge_label_index,
        ).sigmoid().view(-1).cpu()
        target = batch['user', 'item'].edge_label.long().cpu()

        preds.append(pred)
        targets.append(target) #I assumed it was a typo in the original example

    pred = torch.cat(preds, dim=0).numpy()
    target = torch.cat(targets, dim=0).numpy() #I assumed it was a typo in the original example

    acc = accuracy_score(target, pred)
    prec = precision_score(target, pred)
    rec = recall_score(target, pred)
    f1 = f1_score(target, pred)

    return acc, prec, rec, f1
```

### Environment

* PyG version: 
* PyTorch version: 1.13.0
* OS: Linux(Colab)
* Python version: 3.8.10
* CUDA/cuDNN version: 11.6
* How you installed PyTorch and PyG (`conda`, `pip`, source): pip
* Any other relevant information (*e.g.*, version of `torch-scatter`): 



Discussion:

Resolving patch:
diff --git a/examples/hetero/bipartite_sage_unsup.py b/examples/hetero/bipartite_sage_unsup.py
--- a/examples/hetero/bipartite_sage_unsup.py
+++ b/examples/hetero/bipartite_sage_unsup.py
@@ -139,7 +139,7 @@ def forward(self, x_dict, edge_index_dict):
 
         user_x = self.conv3(
             (item_x, user_x),
-            edge_index_dict[('item', 'to', 'user')],
+            edge_index_dict[('item', 'rev_to', 'user')],
         ).relu()
 
         return self.lin(user_x)
@@ -231,11 +231,12 @@ def test(loader):
         target = batch['user', 'item'].edge_label.long().cpu()
 
         preds.append(pred)
-        targets.append(pred)
+        targets.append(target)
 
     pred = torch.cat(preds, dim=0).numpy()
-    target = torch.cat(target, dim=0).numpy()
+    target = torch.cat(targets, dim=0).numpy()
 
+    pred = pred > 0.5
     acc = accuracy_score(target, pred)
     prec = precision_score(target, pred)
     rec = recall_score(target, pred)


Test patch: