We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4402a4a commit df443f0Copy full SHA for df443f0
pgml-extension/pgml_rust/src/orm/dataset.rs
@@ -30,7 +30,10 @@ impl Dataset {
30
31
pub fn distinct_labels(&self) -> u32 {
32
let mut v = HashSet::new();
33
- self.y.iter().for_each(|i| if !i.is_nan() { v.insert(i.to_string()); });
+ // Treat the f32 values as u32 for std::cmp::Eq. We don't
34
+ // care about the nuance of nan equality here, they should
35
+ // already be filtered out upstream.
36
+ self.y.iter().for_each(|i| if !i.is_nan() { v.insert(i.to_bits()); });
37
v.len().try_into().unwrap()
38
}
39
0 commit comments