code: def test_hdbscan_approximate_predict_score():
      clusterer = HDBSCAN(min_cluster_size=200).fit(X)
      # no prediction data error
      assert_raises(
          ValueError, approximate_predict_scores, clusterer, X
      )
      clusterer.generate_prediction_data()
      # wrong dimensions error
      assert_raises(
          ValueError,
          approximate_predict_scores,
          clusterer,
          np.array([[1, 2, 3]]),
      )
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("always")
          approximate_predict_scores(clusterer, np.array([[1.5, -1.0]]))
          # no clusters warning
          assert "Clusterer does not have any defined clusters" in str(
              w[-1].message
          )
      clusterer = HDBSCAN(prediction_data=True).fit(X)
      scores = approximate_predict_scores(clusterer, X)
      assert_array_almost_equal(scores, clusterer.outlier_scores_)
      assert scores.min() >= 0
      assert scores.max() <= 1
  
imports: import numpy
  from scipy.spatial import distance
  from scipy import sparse
  from scipy import stats
  from sklearn.utils.estimator_checks import check_estimator
  from sklearn.utils._testing import assert_array_equal, assert_array_almost_equal, assert_raises
  from hdbscan import HDBSCAN, hdbscan, validity_index, approximate_predict, approximate_predict_scores, membership_vector, all_points_membership_vectors
  from sklearn.datasets import make_blobs
  from sklearn.utils import shuffle
  from sklearn.preprocessing import StandardScaler
  from scipy.stats import mode
  from tempfile import mkdtemp
  from functools import wraps
  import pytest
  from sklearn import datasets
  import warnings
label_desc: Use image node_id 32 for calling a global function with example usage: test_hdbscan_approximate_predict_score() without return types