class_docstr: ClassificationReport visualizer tests
class_docstr_tok: ["ClassificationReport","visualizer","tests"]
docstr: Test that visualizer properly handles missing labels when scoring
docstr_tok: ["Test","that","visualizer","properly","handles","missing","labels","when","scoring"]
code: def test_with_missing_labels(self):
      """
      Test that visualizer properly handles missing labels when scoring
      """
      _, ax = plt.subplots()
  
      X_train = np.array([[1], [2], [3]])
      y_train = np.array([0, 1, 2])
  
      X_test = np.array([[1], [2]])
      y_test = np.array([0, 1])
  
      viz = ClassificationReport(LogisticRegression(), ax=ax)
      viz.fit(X_train, y_train)
      viz.score(X_test, y_test)
  
      assert viz.scores_ == {
          "precision": {0: approx(1.0), 1: approx(1.0), 2: approx(0.0)},
          "recall": {0: approx(1.0), 1: approx(1.0), 2: approx(0.0)},
          "f1": {0: approx(1.0), 1: approx(1.0), 2: approx(0.0)},
      }
  
imports: import sys
  import pytest
  import yellowbrick
  import matplotlib.pyplot
  from yellowbrick.datasets import load_occupancy
  from yellowbrick.classifier.classification_report import *
  from pytest import approx
  from unittest.mock import patch
  from tests.base import VisualTestCase
  from sklearn.svm import LinearSVC, SVC
  from sklearn.naive_bayes import GaussianNB
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  from sklearn.linear_model import LassoCV, LogisticRegression
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import MinMaxScaler
label_desc: Use image node_id 13 for calling the TestClassificationReport obj's underlying member method code with example usage: obj.test_with_missing_labels() without return types