def create_adjusted_predictor(threshold_optimization_method, sensitive_features, labels, scores): post_processed_predictor_by_sensitive_feature = threshold_optimization_method( sensitive_features, labels, scores) return lambda sensitive_features_, scores: _vectorized_prediction( post_processed_predictor_by_sensitive_feature, sensitive_features_, scores)
def prob_pred(sensitive_features, scores): return _vectorized_prediction( estimator._post_processed_predictor_by_sensitive_feature, sensitive_features, scores)