class_docstr: K-Elbow Visualizer Tests
class_docstr_tok: ["K-Elbow","Visualizer","Tests"]
docstr: Test the twinx double axes with k-elbow timings
code: def test_timings(self):
      """
      Test the twinx double axes with k-elbow timings
      """
      visualizer = KElbowVisualizer(
          KMeans(random_state=0), k=5, timings=True, locate_elbow=False
      )
      visualizer.fit(self.clusters.X)
  
      # Check that we kept track of time
      assert len(visualizer.k_timers_) == 4
      assert all([t > 0 for t in visualizer.k_timers_])
  
      # Check that we plotted time on a twinx
      assert hasattr(visualizer, "axes")
      assert len(visualizer.axes) == 2
  
      # delete the timings axes and
      # overwrite k_timers_, k_values_ for image similarity Tests
      visualizer.axes[1].remove()
      visualizer.k_timers_ = [
          0.01084589958190918,
          0.011144161224365234,
          0.017028093338012695,
          0.010634183883666992,
      ]
      visualizer.k_values_ = [2, 3, 4, 5]
  
      # call draw again which is normally called in fit
      visualizer.draw()
      visualizer.finalize()
  
      self.assert_images_similar(visualizer)
  
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 14 for calling the TestKElbowVisualizer obj's underlying member method code with example usage: obj.test_timings() without return types