seldonian.parse_tree.zhat_funcs.sample_from_statistic

sample_from_statistic(model, statistic_name, theta, data_dict, **kwargs)

Calculate a statistical function for each observation in the sample.

Parameters:
  • model – SeldonianModel instance

  • statistic_name (str) – The name of the statistic to evaluate, e.g. ‘FPR’ for false positive rate

  • theta (numpy ndarray) – The model weights

  • data_dict (dict) – Contains the features and labels

Returns:

The evaluated statistic for each observation in the sample

Return type:

numpy ndarray(float)