Skip to content

Commit

Permalink
use top_n parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
jirigav committed Oct 4, 2023
1 parent 9ee3c62 commit 9904972
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ fn results(
training_data: &Data,
testing_data: &Data,
patterns_combined: usize,
top_n: usize,
hist: bool,
) -> (f64, f64) {
final_patterns.sort_by(|a, b| {
Expand All @@ -37,7 +38,7 @@ fn results(
if hist {
hist_result(final_patterns, training_data, testing_data, start)
} else {
let mut best_mp = best_multi_pattern(training_data, &final_patterns, patterns_combined);
let mut best_mp = best_multi_pattern(training_data, &final_patterns.into_iter().take(top_n).collect_vec(), patterns_combined);

println!("trained in {:.2?}", start.elapsed());

Expand Down Expand Up @@ -102,6 +103,7 @@ fn run_bottomup(args: Args) -> (f64, f64) {
&training_data,
&testing_data_option.unwrap(),
args.patterns_combined,
args.top_n,
args.hist,
)
}
Expand Down

0 comments on commit 9904972

Please sign in to comment.