class_docstr: K-Elbow Visualizer Tests
class_docstr_tok: ["K-Elbow","Visualizer","Tests"]
docstr: Test the addition of locate_elbow to an image
code: def test_locate_elbow(self):
      """
      Test the addition of locate_elbow to an image
      """
      X, y = make_blobs(
          n_samples=1000,
          n_features=5,
          centers=3,
          shuffle=True,
          random_state=42,
      )
  
      visualizer = KElbowVisualizer(
          KMeans(random_state=0),
          k=6,
          metric="calinski_harabasz",
          timings=False,
          locate_elbow=True,
      )
      visualizer.fit(X)
      assert len(visualizer.k_scores_) == 5
      assert visualizer.elbow_value_ == 3
      expected = np.array([4286.5, 12463.4, 8766.8, 6950.1, 5863.6])
  
      visualizer.finalize()
      self.assert_images_similar(visualizer, tol=0.5, windows_tol=2.2)
      assert_array_almost_equal(
          visualizer.k_scores_, expected, decimal=1
      )
  
imports: import sys
  import pytest
  import numpy
  import matplotlib.pyplot
  from scipy.sparse import csc_matrix, csr_matrix
  from numpy.testing import assert_array_almost_equal
  from sklearn.datasets import make_blobs
  from sklearn.cluster import KMeans, MiniBatchKMeans
  from sklearn.feature_extraction.text import TfidfVectorizer
  from tests.fixtures import Dataset
  from tests.base import VisualTestCase
  from yellowbrick.datasets import load_hobbies
  from yellowbrick.cluster.elbow import distortion_score
  from yellowbrick.cluster.elbow import KElbowVisualizer, kelbow_visualizer
  from yellowbrick.exceptions import YellowbrickValueError, YellowbrickWarning
  from tests.base import IS_WINDOWS_OR_CONDA
label_desc: Use image node_id 10 for calling the TestKElbowVisualizer obj's underlying member method code with example usage: obj.test_locate_elbow() without return types