class_docstr: Test the PredictionError visualizer
class_docstr_tok: ["Test","the","PredictionError","visualizer"]
docstr: Assert returns R2 score
docstr_tok: ["Assert","returns","R2","score"]
code: def test_score(self):
      """
      Assert returns R2 score
      """
      visualizer = PredictionError(LinearRegression())
  
      visualizer.fit(self.data.X.train, self.data.y.train)
      score = visualizer.score(self.data.X.test, self.data.y.test)
  
      assert score == pytest.approx(0.9999983124154965)
      assert visualizer.score_ == score
  
imports: import pytest
  import matplotlib.pyplot
  import numpy
  from unittest import mock
  from tests.fixtures import Dataset, Split
  from tests.base import IS_WINDOWS_OR_CONDA, VisualTestCase
  from yellowbrick.datasets import load_energy, load_concrete
  from yellowbrick.regressor.prediction_error import PredictionError, prediction_error
  from sklearn.datasets import make_regression
  from sklearn.linear_model import Ridge, Lasso
  from sklearn.neural_network import MLPRegressor
  from sklearn.linear_model import LinearRegression
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.impute import SimpleImputer
label_desc: Use image node_id 4 for calling the TestPredictionError obj's underlying member method code with example usage: obj.test_score() without return types