Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba3e72f

Browse files
authored
fix linker errors (#1012)
1 parent1f6796e commitba3e72f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

‎pgml-extension/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@ pub extern "C" fn _PG_init() {
2929
#[cfg(any(test, feature ="pg_test"))]
3030
#[pg_schema]
3131
mod tests{
32-
usesuper::*;
33-
3432
#[test]
3533
fntest_migration_file_exists(){
3634
let paths = std::fs::read_dir("./sql").unwrap();
3735
for pathin paths{
3836
let path = path.unwrap().path().display().to_string();
39-
if path.contains(VERSION){
37+
if path.contains(crate::VERSION){
4038
return;
4139
}
4240
}
4341

44-
panic!("Migration file for version {} not found",VERSION);
42+
panic!("Migration file for version {} not found",crate::VERSION);
4543
}
4644
}
4745

‎pgml-extension/src/metrics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ impl ConfusionMatrix {
5252
y_hat:&ArrayView1<usize>,
5353
num_classes:usize,
5454
) ->ConfusionMatrix{
55-
if ground_truth.len() != y_hat.len(){
56-
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len())
57-
};
58-
5955
// Distinct classes.
6056
letmut classes = ground_truth.iter().collect::<BTreeSet<_>>();
6157
classes.extend(&mut y_hat.iter().collect::<BTreeSet<_>>().into_iter());
6258

59+
if ground_truth.len() != y_hat.len(){
60+
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len());
61+
}
62+
6363
if num_classes != classes.len(){
64-
error!("Can't compute metrics when the number of classes in the test set is different than the number of classes in the training set. {} != {}", num_classes, classes.len())
65-
};
64+
error!("Can't compute metrics when the number of classes in the test set is different than the number of classes in the training set. {} != {}", num_classes, classes.len());
65+
}
6666

6767
// Class value = index in the confusion matrix
6868
// e.g. class value 5 will be index 4 if there are classes 1, 2, 3 and 4 present.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp