class_docstr: Test the InterclusterDistance visualizer
class_docstr_tok: ["Test","the","InterclusterDistance","visualizer"]
docstr: Visual similarity with LDA and MDS scaling
docstr_tok: ["Visual","similarity","with","LDA","and","MDS","scaling"]
code: def test_lda_mds(self):
      """
      Visual similarity with LDA and MDS scaling
      """
      model = LDA(9, random_state=6667)
      oz = InterclusterDistance(
          model, random_state=2332, embedding="mds"
      )
  
      # Prefit assertions
      assert_not_fitted(oz)
  
      assert oz.fit(self.blobs12.X) is oz  # Fit returns self
  
      # Postfit assertions
      assert_fitted(oz)
      assert oz.embedded_centers_.shape[0] == oz.scores_.shape[0]
      assert (
          oz.embedded_centers_.shape[0] == oz.cluster_centers_.shape[0]
      )
      assert len(oz._score_clusters(self.blobs12.X)) == 9
      assert len(oz._get_cluster_sizes()) == 9
  
      # Image similarity
      oz.finalize()
      self.assert_images_similar(oz, tol=1.0)
  
imports: import pytest
  import matplotlib
  import numpy
  from yellowbrick.cluster.icdm import *
  from yellowbrick.datasets import load_nfl
  from yellowbrick.exceptions import YellowbrickValueError
  from unittest import mock
  from tests.fixtures import Dataset
  from tests.base import IS_WINDOWS_OR_CONDA, VisualTestCase
  from sklearn.datasets import make_blobs
  from sklearn.cluster import Birch, AgglomerativeClustering
  from sklearn.decomposition import LatentDirichletAllocation
  from sklearn.cluster import KMeans, AffinityPropagation, MiniBatchKMeans
  from sklearn.pipeline import Pipeline
  from sklearn.impute import SimpleImputer
label_desc: Use image node_id 5 for calling the TestInterclusterDistance obj's underlying member method code with example usage: obj.test_lda_mds() without return types