class_docstr: Evaluate feature importance weights on data pages
class_docstr_tok: ["Evaluate","feature","importance","weights","on","data","pages"]
code: def compute_median_feature_value(self, features):
      # enum type
      if features.shape[1] > 1:
          feature_counts = torch.sum(features, dim=0)
          median_feature_counts = torch.median(feature_counts)
          # no similar method as numpy.where in torch
          for i in range(features.shape[1]):
              if feature_counts[i] == median_feature_counts:
                  break
          median_feature = torch.zeros(features.shape[1])
          median_feature[i] = 1
      # other types
      else:
          median_feature = features.mean(dim=0)
      return median_feature
  
file_path: ReAgent/reagent/evaluation/world_model_evaluator.py
imports: import logging
  from typing import Dict, List
  import torch
  from reagent.core.types import FeatureData, MemoryNetworkInput
  from reagent.training.world_model.mdnrnn_trainer import MDNRNNTrainer
label_desc: Use image node_id 3 for calling the FeatureImportanceEvaluator obj's underlying member method code with example usage: obj.compute_median_feature_value(features) and returns: median_feature