docstr: Test intra_list_similarity function
docstr_tok: ["Test","intra_list_similarity","function"]
code: def test_intra_list_similarity(self):
      """
      Test intra_list_similarity function
      """
  
      # GIVEN test predictions and a feature matrix (formatted as a DataFrame)
  
      test_predictions = [
          [3, 7, 5, 9],
      ]
  
      lst_features = {
          1: {"Action": 0, "Comedy": 0, "Romance": 0},
          2: {"Action": 0, "Comedy": 0, "Romance": 0},
          3: {"Action": 0, "Comedy": 1, "Romance": 0},
          4: {"Action": 0, "Comedy": 1, "Romance": 0},
          5: {"Action": 0, "Comedy": 1, "Romance": 0},
          6: {"Action": 1, "Comedy": 0, "Romance": 0},
          7: {"Action": 0, "Comedy": 1, "Romance": 0},
          8: {"Action": 0, "Comedy": 0, "Romance": 0},
          9: {"Action": 1, "Comedy": 0, "Romance": 0},
          10: {"Action": 1, "Comedy": 0, "Romance": 0},
      }
  
      feature_df = (
          pd.DataFrame.from_dict(lst_features, orient="index")
          .reset_index()
          .rename(columns={"index": "movieId"})
          .set_index("movieId")
      )
  
      # WHEN metrics.intra_list_similarity is run
      intra_list_similarity = metrics.intra_list_similarity(
          test_predictions, feature_df
      )
  
      # THEN the expected value should be 0.5 within 3 decimal places
      self.assertAlmostEqual(intra_list_similarity, 0.5, places=3)
  
file_path: recmetrics/tests/test_metrics.py
imports: import unittest
  from unittest import mock
  import pandas
  from recmetrics import metrics
label_desc: Use image node_id 7 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_intra_list_similarity() without return types