Skip to content

Commit

Permalink
Merge pull request #47 from jademackay/postprocessing-types
Browse files Browse the repository at this point in the history
Change postprocessing structs subtyping
  • Loading branch information
ashryaagr authored Sep 24, 2020
2 parents af1d61a + 2f2dbea commit 83096db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/algorithms/postprocessing/eqOdds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/algorithms/postprocessing/linprog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 83096db

Please sign in to comment.