code: def test_quantile(self) -> None:
      q1 = cflearn.api.make_metric("quantile", q=0.1)
      q3 = cflearn.api.make_metric("quantile", q=0.3)
      q5 = cflearn.api.make_metric("quantile", q=0.5)
      q7 = cflearn.api.make_metric("quantile", q=0.7)
      q9 = cflearn.api.make_metric("quantile", q=0.9)
      labels = np.linspace(0, 1, 11).reshape([11, 1])
      p1 = np.full_like(labels, 0.1)
      p3 = np.full_like(labels, 0.3)
      p5 = np.full_like(labels, 0.5)
      p7 = np.full_like(labels, 0.7)
      p9 = np.full_like(labels, 0.9)
      self.assertAlmostEqual(
          _get_score(q1, p1, labels), -0.04909090909090909
      )
      self.assertAlmostEqual(
          _get_score(q3, p1, labels), -0.12909090909090912
      )
      self.assertAlmostEqual(
          _get_score(q3, p3, labels), -0.11454545454545455
      )
      self.assertAlmostEqual(
          _get_score(q3, p5, labels), -0.13636363636363635
      )
      self.assertAlmostEqual(
          _get_score(q5, p3, labels), -0.15454545454545457
      )
      self.assertAlmostEqual(
          _get_score(q5, p5, labels), -0.13636363636363635
      )
      self.assertAlmostEqual(
          _get_score(q5, p7, labels), -0.15454545454545457
      )
      self.assertAlmostEqual(
          _get_score(q7, p5, labels), -0.13636363636363635
      )
      self.assertAlmostEqual(
          _get_score(q7, p7, labels), -0.11454545454545456
      )
      self.assertAlmostEqual(
          _get_score(q7, p9, labels), -0.12909090909090912
      )
      self.assertAlmostEqual(
          _get_score(q9, p7, labels), -0.07454545454545457
      )
      self.assertAlmostEqual(
          _get_score(q9, p9, labels), -0.04909090909090908
      )
  
file_path: carefree-learn/tests/test_metrics.py
imports: import cflearn
  import unittest
  import numpy
  from cflearn.schema import IMetric
  from cflearn.constants import LABEL_KEY
  from cflearn.constants import PREDICTIONS_KEY
label_desc: Use image node_id 2 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_quantile() without return types