Skip to content

Commit

Permalink
add generic for half space trees
Browse files Browse the repository at this point in the history
  • Loading branch information
AdilZouitine committed Oct 14, 2023
1 parent 1b78aa3 commit 7ea3985
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/anomaly_detection/credit_card.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use light_river::anomaly::half_space_tree::HalfSpaceTree;
use light_river::datasets::credit_card::CreditCard;
use light_river::stream::iter_csv::IterCsv;
use std::fs::File;
use std::time::Instant;

fn main() {
Expand All @@ -11,10 +13,10 @@ fn main() {
let height: u32 = 6;

// INITIALIZATION
let mut hst = HalfSpaceTree::new(window_size, n_trees, height, None);
let mut hst: HalfSpaceTree<f32> = HalfSpaceTree::new(window_size, n_trees, height, None);

// LOOP
let transactions = CreditCard::load_credit_card_transactions().unwrap();
let transactions: IterCsv<f32, File> = CreditCard::load_credit_card_transactions().unwrap();
for transaction in transactions {
let observation = transaction.unwrap().get_observation();
let _ = hst.update(&observation, true, true);
Expand Down

0 comments on commit 7ea3985

Please sign in to comment.