code: def test_oob_score(make_whas500, forest_cls, expected_oob_score):
      whas500 = make_whas500(to_numeric=True)
  
      forest = forest_cls(
          oob_score=True, bootstrap=False, random_state=2
      )
      with pytest.raises(
          ValueError,
          match="Out of bag estimation only available if bootstrap=True",
      ):
          forest.fit(whas500.x, whas500.y)
  
      forest.set_params(bootstrap=True)
      forest.fit(whas500.x, whas500.y)
  
      assert forest.oob_prediction_.shape == (whas500.x.shape[0],)
      assert forest.oob_score_ == pytest.approx(expected_oob_score)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  import pytest
  from scipy import sparse
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import make_pipeline
  from sksurv.datasets import load_breast_cancer
  from sksurv.ensemble import ExtraSurvivalTrees, RandomSurvivalForest
  from sksurv.preprocessing import OneHotEncoder
  from sksurv.testing import assert_chf_properties, assert_cindex_almost_equal, assert_survival_function_properties
  from sksurv.tree import SurvivalTree
label_desc: Use image node_id 5 for calling a global function with example usage: test_oob_score(make_whas500, forest_cls, expected_oob_score) without return types