Skip to content

Commit 775c9f3

Browse files
committedJan 28, 2022
add heart_disease.csv to repo, fix seeded monitors in test
1 parent 0078de8 commit 775c9f3

File tree

4 files changed

+311
-6
lines changed

4 files changed

+311
-6
lines changed
 

‎crates/app/core/monitor_checker.rs

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ mod test {
531531
.await
532532
.unwrap();
533533
app.commit_transaction(txn).await.unwrap();
534+
dbg!(&all_alerts);
534535
assert_eq!(all_alerts.len(), 1);
535536

536537
// Scroll to one day, check that daily alert is created

‎crates/app/core/test_common.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub async fn init_heart_disease_model(app: &App) -> Result<Id> {
6767
pub async fn seed_events(app: &App, examples_count: usize, model_id: Id) -> Result<()> {
6868
let target = "diagnosis";
6969
let class_names = Some(&["Negative", "Positive"]);
70-
let data_path = workspace_root().join("data").join("heart_disease.csv");
70+
let data_path = workspace_root().join("heart_disease.csv");
7171
let table = tangram_table::Table::from_path(&data_path, Default::default(), &mut |_| {})?;
7272
let mut idx = 0;
7373
let events: Vec<MonitorEvent> = (0..examples_count)
@@ -231,7 +231,7 @@ enum Diagnosis {
231231
}
232232
/// Returns the ID of the prediction as well as the predicted value
233233
pub async fn seed_single_prediction_event(app: &App, model_id: Id) -> Result<(Id, String)> {
234-
let data_path = workspace_root().join("data").join("heart_disease.csv");
234+
let data_path = workspace_root().join("heart_disease.csv");
235235
let table = tangram_table::Table::from_path(&data_path, Default::default(), &mut |_| {})?;
236236

237237
let id = Id::generate();
@@ -366,8 +366,8 @@ pub async fn seed_monitors(app: &App, model_id: Id) -> Result<()> {
366366
threshold: MonitorThreshold {
367367
metric: AlertMetric::Accuracy,
368368
mode: MonitorThresholdMode::Absolute,
369-
difference_lower: Some(0.5),
370-
difference_upper: Some(0.5),
369+
difference_lower: Some(0.1),
370+
difference_upper: Some(0.1),
371371
},
372372
title: None,
373373
},
@@ -376,7 +376,7 @@ pub async fn seed_monitors(app: &App, model_id: Id) -> Result<()> {
376376
threshold: MonitorThreshold {
377377
metric: AlertMetric::Accuracy,
378378
mode: MonitorThresholdMode::Percentage,
379-
difference_lower: Some(0.3),
379+
difference_lower: Some(20.0),
380380
difference_upper: None,
381381
},
382382
title: None,

‎crates/app/seed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct DatasetConfig {
4242
}
4343

4444
const HEART_DISEASE: DatasetConfig = DatasetConfig {
45-
path: "data/heart_disease.csv",
45+
path: "heart_disease.csv",
4646
model_path: "heart_disease.tangram",
4747
name: "heart_disease",
4848
target: "diagnosis",

‎heart_disease.csv

+304
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.