class_docstr: For details, visit https://arxiv.org/pdf/1612.01205.pdf
class_docstr_tok: ["For","details",",","visit","https",":","\/\/arxiv.org\/pdf\/1612.01205.pdf"]
code: def _get_importance_sampling_inputs(
      self, ed: EstimationData
  ) -> ImportanceSamplingData:
      target_propensity_for_action = torch.sum(
          ed.model_propensities_eval * ed.action_mask_eval,
          dim=1,
          keepdim=True,
      )
      # target_propensity_for_action is N*1 tensor of target algo propensities
      # for historical actions
      # logged_propensities_eval is N*1 tensor of propensity scores for historical
      # actions by the prod algorithm at each context
      importance_weights = (
          target_propensity_for_action / ed.logged_propensities_eval
      ).float()
      logger.info(
          f"Mean IPS weight on the eval dataset: {importance_weights.mean()}"
      )
      return ImportanceSamplingData(
          importance_weight=importance_weights,
          logged_rewards=ed.logged_rewards_eval,
          model_rewards=ed.model_rewards_eval,
          model_rewards_for_logged_action=ed.model_rewards_for_logged_action_eval,
          model_propensities=ed.model_propensities_eval,
      )
  
imports: import logging
  from dataclasses import dataclass
  from typing import Dict, NamedTuple, Optional, Tuple, Union
  import numpy
  import torch
  from reagent.evaluation.cpe import bootstrapped_std_error_of_mean, CpeEstimate
  from reagent.evaluation.evaluation_data_page import EvaluationDataPage
  from torch import Tensor
label_desc: Use image node_id 3 for calling the DoublyRobustEstimator obj's underlying member method code with example usage: obj._get_importance_sampling_inputs(ed) and returns: ImportanceSamplingData