From 2f2dbea86605e8770591daf5742352e495c5f271 Mon Sep 17 00:00:00 2001 From: Jade Mackay Date: Wed, 23 Sep 2020 12:57:06 +1200 Subject: [PATCH] Change postpreocessing structs (`EqOddsWrapper` and `LinProgWrapper`) to subtype `Deterministic` rather the `DeterministicComposite`. --- src/algorithms/postprocessing/eqOdds.jl | 2 +- src/algorithms/postprocessing/linprog.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algorithms/postprocessing/eqOdds.jl b/src/algorithms/postprocessing/eqOdds.jl index 71d5bea..f406556 100644 --- a/src/algorithms/postprocessing/eqOdds.jl +++ b/src/algorithms/postprocessing/eqOdds.jl @@ -3,7 +3,7 @@ It is a postprocessing algorithm which uses Linear Programming to optimise the constraints for Equalized Odds. """ -struct EqOddsWrapper{M<:MLJBase.Model} <: DeterministicComposite +struct EqOddsWrapper{M<:MLJBase.Model} <: Deterministic grp::Symbol classifier::M end diff --git a/src/algorithms/postprocessing/linprog.jl b/src/algorithms/postprocessing/linprog.jl index d04c308..08118a4 100644 --- a/src/algorithms/postprocessing/linprog.jl +++ b/src/algorithms/postprocessing/linprog.jl @@ -21,7 +21,7 @@ end It is a postprocessing algorithm that uses JuMP and Ipopt library to minimise error and satisfy the equality of specified specified measures for all groups at the same time. Automatic differentiation and gradient based optimisation is used to find probabilities with which the predictions are changed for each group. """ -struct LinProgWrapper{M<:MLJBase.Model} <: DeterministicComposite +struct LinProgWrapper{M<:MLJBase.Model} <: Deterministic grp::Symbol classifier::M measures::Array{<:Measure} @@ -110,7 +110,7 @@ function MMI.fit(model::LinProgWrapper, verbosity::Int, X, y) # fitresult will provide the info we require in the predict function. fitresult = [[JuMP.value.(p2n), JuMP.value.(n2p)], mch.fitresult, labels] - # Note: It was necessary to return the levels(y) value in fitreult because in predict there + # Note: It was necessary to return the levels(y) value in fitresult because in predict there # is no way to infer the 2 possible values of labels/targets. # Main reason to return values is the edge case : Maybe all of the ŷ predictions are same and we don't get to know both labels