code: def _get_categorical_score(
              self,
              profile: List,
              negated_classes: List,
              categories: List,
              negation_weight: Optional[float] = 1,
              ic_map: Optional[Dict[str, float]] = None) -> float:
          
  
          if ic_map is None:
              ic_map = self.ic_store.get_profile_ic(profile + negated_classes)
  
          scores = []
  
          for cat in categories:
              if cat not in self.ic_store.category_statistics:
                  raise ValueError("statistics for {} not indexed".format(cat))
  
              pos_profile = [cls for cls in profile
                             if cls in self.ic_store.category_statistics[cat].descendants]
              neg_profile = [cls for cls in negated_classes
                             if cls in self.ic_store.category_statistics[cat].descendants]
  
              # Note that we're deviating from the publication
              # to match the reference java implementation where
              # mean_max_ic is replaced by max_max_ic
              scores.append(self._get_simple_score(
                  pos_profile, neg_profile,
                  self.ic_store.category_statistics[cat].mean_mean_ic,
                  self.ic_store.category_statistics[cat].max_max_ic,
                  self.ic_store.category_statistics[cat].mean_sum_ic,
                  negation_weight, ic_map
              ))
          return mean(scores)
docs: The average of the simple scores across a list of categories