pub fn assert_approx_eq<P: Into<Self>>(&self, expected: P) {
        let expected = expected.into();
        assert_eq!(
            self.id, expected.id,
            "Expected class ID {} but found {}",
            expected.id, self.id
        );
        let approx_matches = self.approx_eq(&expected, DEFAULT_MARGIN);
        assert!(
            approx_matches,
            "Expected probability {} but found {} (outside of default margin of error)",
            expected.prob, self.prob
        );
    }
/// Reduce the boilerplate to assert that two predictions are approximately the same.
Reduce the boilerplate to assert that two predictions are approximately the same.
Reduce the boilerplate to assert that two predictions are approximately the same .
pub fn assert_approx_eq<P: Into<Self>>(&self, expected: P) {
        let expected = expected.into();
        assert_eq!(
            self.id, expected.id,
            "Expected class ID {} but found {}",
            expected.id, self.id
        );
        let approx_matches = self.approx_eq(&expected, DEFAULT_MARGIN);
        assert!(
            approx_matches,
            "Expected probability {} but found {} (outside of default margin of error)",
            expected.prob, self.prob
        );
    }
pub fn assert_approx_eq < P : Into < Self > > ( & self , expected : P ) { let expected = expected . into ( ) ; assert_eq ! ( self id expected id " " expected id self id ) ; let approx_matches = self . approx_eq ( & expected , DEFAULT_MARGIN ) ; assert ! ( approx_matches " " expected prob self prob ) ; }
Reduce the boilerplate to assert that two predictions are approximately the same.
Reduce the boilerplate to assert that two predictions are approximately the same .
&self
expected
P
&self
expected
P