Handle multiclass precision/recall (#152)

* handle multiclass precision/recall
This commit is contained in:
Montana Low
2022-09-13 08:23:45 -07:00
committed by GitHub
parent e445f0d558
commit 2e5f88fad8
3 changed files with 97 additions and 46 deletions
+12 -1
View File
@@ -46,8 +46,11 @@ pub trait RealNumber:
self * self
}
/// Raw transmutation to u64
/// Raw transmutation to u32
fn to_f32_bits(self) -> u32;
/// Raw transmutation to u64
fn to_f64_bits(self) -> u64;
}
impl RealNumber for f64 {
@@ -89,6 +92,10 @@ impl RealNumber for f64 {
fn to_f32_bits(self) -> u32 {
self.to_bits() as u32
}
fn to_f64_bits(self) -> u64 {
self.to_bits()
}
}
impl RealNumber for f32 {
@@ -130,6 +137,10 @@ impl RealNumber for f32 {
fn to_f32_bits(self) -> u32 {
self.to_bits()
}
fn to_f64_bits(self) -> u64 {
self.to_bits() as u64
}
}
#[cfg(test)]