pub struct RademacherComplexity {
pub n: usize,
pub class_size: usize,
}Expand description
Rademacher complexity estimate for a finite hypothesis class.
For a finite class H of size |H| over n samples: R_n(H) ≤ √(2 ln|H| / n).
Fields§
§n: usizeNumber of samples n.
class_size: usizeNumber of hypotheses in the class |H|.
Implementations§
Source§impl RademacherComplexity
impl RademacherComplexity
Sourcepub fn upper_bound(&self) -> f64
pub fn upper_bound(&self) -> f64
Upper bound: √(2 ln|H| / n).
Sourcepub fn generalization_bound(&self, empirical_loss: f64, delta: f64) -> f64
pub fn generalization_bound(&self, empirical_loss: f64, delta: f64) -> f64
Generalization bound: L_D(h) ≤ L_S(h) + 2 R_n(H) + √(log(2/δ)/(2n)).
Auto Trait Implementations§
impl Freeze for RademacherComplexity
impl RefUnwindSafe for RademacherComplexity
impl Send for RademacherComplexity
impl Sync for RademacherComplexity
impl Unpin for RademacherComplexity
impl UnsafeUnpin for RademacherComplexity
impl UnwindSafe for RademacherComplexity
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