pub struct FairnessMetrics {
pub disparate_impact_ratio: f32,
pub equal_opportunity_diff: f32,
pub demographic_parity_diff: f32,
pub group_metrics: HashMap<String, GroupMetrics>,
pub passed: bool,
}Expand description
Fairness metrics result
Fields§
§disparate_impact_ratio: f32Disparate Impact Ratio (should be >= 0.8)
equal_opportunity_diff: f32Equal Opportunity Difference (should be <= 0.1)
demographic_parity_diff: f32Demographic Parity Difference
group_metrics: HashMap<String, GroupMetrics>Per-group metrics
passed: boolOverall fairness passed
Implementations§
Source§impl FairnessMetrics
impl FairnessMetrics
Sourcepub fn new(
disparate_impact_ratio: f32,
equal_opportunity_diff: f32,
demographic_parity_diff: f32,
config: &FairnessConfig,
) -> Self
pub fn new( disparate_impact_ratio: f32, equal_opportunity_diff: f32, demographic_parity_diff: f32, config: &FairnessConfig, ) -> Self
Create new fairness metrics
Sourcepub fn add_group(&mut self, group_name: String, metrics: GroupMetrics)
pub fn add_group(&mut self, group_name: String, metrics: GroupMetrics)
Add metrics for a specific group
Trait Implementations§
Source§impl Clone for FairnessMetrics
impl Clone for FairnessMetrics
Source§fn clone(&self) -> FairnessMetrics
fn clone(&self) -> FairnessMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FairnessMetrics
impl RefUnwindSafe for FairnessMetrics
impl Send for FairnessMetrics
impl Sync for FairnessMetrics
impl Unpin for FairnessMetrics
impl UnwindSafe for FairnessMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more