Skip to content

fix linker errors #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pgml-extension/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ pub extern "C" fn _PG_init() {
#[cfg(any(test, feature = "pg_test"))]
#[pg_schema]
mod tests {
use super::*;

#[test]
fn test_migration_file_exists() {
let paths = std::fs::read_dir("./sql").unwrap();
for path in paths {
let path = path.unwrap().path().display().to_string();
if path.contains(VERSION) {
if path.contains(crate::VERSION) {
return;
}
}

panic!("Migration file for version {} not found", VERSION);
panic!("Migration file for version {} not found", crate::VERSION);
}
}

Expand Down
12 changes: 6 additions & 6 deletions pgml-extension/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ impl ConfusionMatrix {
y_hat: &ArrayView1<usize>,
num_classes: usize,
) -> ConfusionMatrix {
if ground_truth.len() != y_hat.len() {
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len())
};

// Distinct classes.
let mut classes = ground_truth.iter().collect::<BTreeSet<_>>();
classes.extend(&mut y_hat.iter().collect::<BTreeSet<_>>().into_iter());

if ground_truth.len() != y_hat.len() {
error!("Can't compute metrics when the ground truth labels are a different size than the predicted labels. {} != {}", ground_truth.len(), y_hat.len());
}

if num_classes != classes.len() {
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())
};
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());
}

// Class value = index in the confusion matrix
// e.g. class value 5 will be index 4 if there are classes 1, 2, 3 and 4 present.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy