code: def _eval_rule_perf(rule: str, X, y) -> Tuple[float, float]:
      detected_index = list(X.query(rule).index)
      if len(detected_index) <= 1:
          return (0, 0)
      y_detected = y[detected_index]
      true_pos = y_detected[y_detected > 0].sum()
      if true_pos == 0:
          return (0, 0)
      pos = y[y > 0].sum()
      return y_detected.mean(), float(true_pos) / pos
  
file_path: imodels/imodels/util/score.py
imports: from typing import List, Tuple
  from warnings import warn
  import pandas
  import numpy
  from sklearn.utils import indices_to_mask
  from sklearn.linear_model import Lasso, LogisticRegression
  from sklearn.linear_model._coordinate_descent import _alpha_grid
  from sklearn.model_selection import cross_val_score
  from imodels.util.rule import Rule
label_desc: Use image node_id 2 for calling a global function with example usage: _eval_rule_perf(rule, X, y) and returns: y_detected,  unknown, int,  int, int,  int