Skip to content

Commit

Permalink
Test update
Browse files Browse the repository at this point in the history
  • Loading branch information
federicapicogna committed Dec 19, 2024
1 parent 58ede5e commit 49136be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-fairness-selection.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test_that(desc = "Validation of fairness selection", {
expect_equal(outcome$measure, "pp")
# Equalized odds
outcome <- fairness_selection(q1 = 1, q2 = 3)
expect_equal(outcome$measure, "dp")
expect_equal(outcome$measure, "eo")
# False negative rate parity
outcome <- fairness_selection(q1 = 1, q2 = 2, q3 = NULL, q4 = 2)
expect_equal(outcome$measure, "fnrp")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-model-fairness.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test_that(desc = "Benchmark against fairness package", {
fairness_tpr <- fairness::equal_odds(compas, outcome = "TwoYrRecidivism", preds = "Predicted", group = "Ethnicity", outcome_base = "no", base = "Caucasian")$Metric
expect_equal(jfa_tprp[["metric"]][["all"]][["estimate"]], as.numeric(fairness_tpr[1, ]))
expect_equal(jfa_tprp[["parity"]][["all"]][["estimate"]], as.numeric(fairness_tpr[2, ]))
# Negative predicted value parity
# Negative predictive value parity
jfa_npvp <- model_fairness(compas, "Ethnicity", "TwoYrRecidivism", "Predicted", privileged = "Caucasian", positive = "yes", metric = "npvp")
fairness_npv <- fairness::npv_parity(compas, outcome = "TwoYrRecidivism", preds = "Predicted", group = "Ethnicity", outcome_base = "no", base = "Caucasian")$Metric
expect_equal(jfa_npvp[["metric"]][["all"]][["estimate"]], as.numeric(fairness_npv[1, ]))
Expand Down

0 comments on commit 49136be

Please sign in to comment.