code: def test_affinity_propagation_class(self):
      from sklearn.datasets.samples_generator import make_blobs
  
      centers = [[1, 1], [-1, -1], [1, -1]]
      X, labels_true = make_blobs(
          n_samples=300,
          centers=centers,
          cluster_std=0.5,
          random_state=0,
      )
  
      df = pdml.ModelFrame(data=X, target=labels_true)
      af = df.cluster.AffinityPropagation(preference=-50)
      df.fit(af)
  
      af2 = cluster.AffinityPropagation(preference=-50).fit(X)
  
      tm.assert_numpy_array_equal(
          af.cluster_centers_indices_, af2.cluster_centers_indices_
      )
      tm.assert_numpy_array_equal(af.labels_, af2.labels_)
  
imports: import pytest
  import numpy
  import sklearn.datasets
  import sklearn.cluster
  import sklearn.preprocessing
  import sklearn.metrics
  import pandas_ml
  import pandas_ml.util.testing
label_desc: Use image node_id 6 for calling the TestCluster obj's underlying member method code with example usage: obj.test_affinity_propagation_class() without return types