class_docstr: Test that implementation matches sklearns.
class_docstr_tok: ["Test","that","implementation","matches","sklearns","."]
docstr: Check that pair cluster confusion matrix is calculated correctly.
docstr_tok: ["Check","that","pair","cluster","confusion","matrix","is","calculated","correctly","."]
code: def test_pair_cluster_confusion_matrix(self, preds, target):
      """Check that pair cluster confusion matrix is calculated correctly."""
      tm_res = calculate_pair_cluster_confusion_matrix(preds, target)
      sklearn_res = sklearn_pair_confusion_matrix(preds, target)
      assert np.allclose(tm_res, sklearn_res, atol=self.atol)
  
file_path: torchmetrics/tests/unittests/clustering/test_utils.py
imports: import numpy
  import pytest
  import torch
  from sklearn.metrics.cluster import contingency_matrix
  from sklearn.metrics.cluster import entropy
  from sklearn.metrics.cluster import pair_confusion_matrix
  from sklearn.metrics.cluster._supervised import _generalized_average
  from torchmetrics.functional.clustering.utils import calculate_contingency_matrix, calculate_entropy, calculate_generalized_mean, calculate_pair_cluster_confusion_matrix
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
label_desc: Use image node_id 1 for calling the TestPairClusterConfusionMatrix obj's underlying member method code with example usage: obj.test_pair_cluster_confusion_matrix(preds, target) without return types