code: def test_postprocessingmeta_fnr(old_adult, new_adult):
      """Test that the old and new CalibratedEqualizedOdds produce the same
      probability predictions.
  
      This tests the whole "pipeline": splitting the data the same way, training a
      LogisticRegression classifier, and training the post-processor the same way.
      """
      X, y, sample_weight = new_adult
      adult_train, adult_test = old_adult.split([0.9], shuffle=False)
      X_tr, X_te, y_tr, _, sw_tr, _ = train_test_split(
          X, y, sample_weight, train_size=0.9, shuffle=False
      )
  
      assert np.all(adult_train.features == X_tr)
      assert np.all(adult_test.features == X_te)
      assert np.all(adult_train.labels.ravel() == y_tr)
  
      adult_est, adult_post = adult_train.split([0.75], shuffle=False)
  
      logreg = LogisticRegression(solver="lbfgs", max_iter=500)
      logreg.fit(
          adult_est.features,
          adult_est.labels.ravel(),
          sample_weight=adult_est.instance_weights,
      )
      probas_pred = logreg.predict_proba(adult_post.features)[:, 1]
  
      adult_pred = adult_post.copy()
      adult_pred.scores = probas_pred
  
      orig_cal_eq_odds = CalibratedEqOddsPostprocessing(
          unprivileged_groups=[{"sex": 0}],
          privileged_groups=[{"sex": 1}],
          cost_constraint="fnr",
          seed=0,
      )
      orig_cal_eq_odds.fit(adult_post, adult_pred)
  
      cal_eq_odds = PostProcessingMeta(
          estimator=logreg,
          postprocessor=CalibratedEqualizedOdds(
              "sex", cost_constraint="fnr", random_state=0
          ),
          shuffle=False,
      )
      cal_eq_odds.fit(X_tr, y_tr, sample_weight=sw_tr)
  
      assert np.allclose(logreg.coef_, cal_eq_odds.estimator_.coef_)
  
      assert np.allclose(
          [
              orig_cal_eq_odds.unpriv_mix_rate,
              orig_cal_eq_odds.priv_mix_rate,
          ],
          cal_eq_odds.postprocessor_.mix_rates_,
      )
  
      adult_test_pred = adult_test.copy()
      adult_test_pred.scores = logreg.predict_proba(
          adult_test.features
      )[:, 1]
      adult_test_pred = orig_cal_eq_odds.predict(adult_test_pred)
  
      y_test_pred = cal_eq_odds.predict_proba(X_te)
  
      assert np.allclose(adult_test_pred.scores, y_test_pred[:, 1])
  
file_path: AIF360/tests/sklearn/test_calibrated_equalized_odds.py
imports: import numpy
  import pytest
  import sklearn
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import train_test_split
  from aif360.algorithms.postprocessing import CalibratedEqOddsPostprocessing
  from aif360.sklearn.postprocessing import CalibratedEqualizedOdds, PostProcessingMeta
label_desc: Use image node_id 2 for calling a global function with example usage: test_postprocessingmeta_fnr(old_adult, new_adult) without return types