Skip to content

Add Error bars #235

Closed
Closed

Description

@rihorn2

Show error bars in reports when available

Activity

  1. added this to the milestone on Jan 14, 2020
  2. added
    enhancement
    on Jan 14, 2020
  3. removed this from the milestone on Jun 22, 2020
  4. michaelamoako commented on May 11, 2021

    @michaelamoako
    Contributor

    @hildeweerts I think your comment on #796 is relevant here too (guidance would be needed around how to understand the results)

  5. michaelamoako commented on May 12, 2021

    @michaelamoako
    Contributor

    There are a few potential implementations of Error bars/ Confidence bounds. My question is, how do we present them in a way that is clear and actionable. An example of one potential implementation (using the MetricFrame, though you could imagine this being woven into the plots as well) is below.

    Wilson bounds
    (@LeJit and Duncan)

    def wilson(p, n, z = z_score):
        denominator = 1 + z**2/n
        centre_adjusted_probability = p + z*z / (2*n)
        adjusted_standard_deviation = np.sqrt((p*(1 - p) + z*z / (4*n)))/np.sqrt(n)
        lower_bound = (centre_adjusted_probability - z*adjusted_standard_deviation) / denominator
        upper_bound = (centre_adjusted_probability + z*adjusted_standard_deviation) / denominator
        return (lower_bound, upper_bound)
    

    Using the above, you could then define functions for each bound, for a specific metric, and pass that into the metric frame.

    The output of the Metric Frame using mock data with race and gender as sensitive features, and a z-score of 1.96 (p-value of 0.05) 
    

    Bounds (snipped)

    The issue with the above is that MetricFrame will run into issues with equality and difference operators

  6. riedgar-ms commented on May 14, 2021

    @riedgar-ms
    Member

    Thank you for reanimating this discussion @michaelamoako !

    As I said in the community call, I think that the statistical issues are too fraught for us to try offering error bounds intrinsically within MetricFrame. However, we absolutely should have examples for users to follow, similar to the one you give above. And as @MiroDudik mentioned on the call, we can adjust the MetricFrame so that when there are non-comparable columns (such as the confidence bounds, or a confusion matrix), a NaN is returned, rather than throwing an exception.

  7. riedgar-ms commented on Jun 2, 2021

    @riedgar-ms
    Member

    Talking to @alexquach about working on this.

  8. riedgar-ms commented on Jun 2, 2021

    @riedgar-ms
    Member

    It would be good if three different formats for the errors:

    • +/- number
    • + number, - number
    • lower bound, upper bound (as @michaelamoako has above)
  9. alexquach commented on Jul 8, 2021

    @alexquach
    Contributor

    I'm working on this.

  10. TamaraAtanasoska commented on Jun 27, 2024

    @TamaraAtanasoska
    Contributor

    Does the work done until now complete this issue @riedgar-ms, including the last work done in 37d20a8? Or there is still more to be done?

  11. riedgar-ms commented on Jun 27, 2024

    @riedgar-ms
    Member

    I'm not sure this is relevant any more.

  12. hildeweerts commented on Jun 27, 2024

    @hildeweerts
    Contributor

    Agreed @TamaraAtanasoska @riedgar-ms - I'm closing the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions