Skip to content
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

Add an option to turn off outlier filter when benchmark #136

Closed
L-M-Sherlock opened this issue Dec 16, 2023 · 1 comment · Fixed by #137
Closed

Add an option to turn off outlier filter when benchmark #136

L-M-Sherlock opened this issue Dec 16, 2023 · 1 comment · Fixed by #137
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@L-M-Sherlock
Copy link
Member

The outlier filter has been applied in benchmark dataset. But current FSRS-rs applies the outlier filter inside the API. So the outlier filter is applied twice, which is unintended. @dae, could help me add an option to turn off outlier filter when benchmark?

@L-M-Sherlock L-M-Sherlock added enhancement New feature or request help wanted Extra attention is needed labels Dec 16, 2023
@dae
Copy link
Collaborator

dae commented Dec 17, 2023

Simplest approach would be to control it with an env var, e.g.

diff --git a/src/dataset.rs b/src/dataset.rs
index dcf047e..71a9f28 100644
--- a/src/dataset.rs
+++ b/src/dataset.rs
@@ -139,6 +139,9 @@ pub fn filter_outlier(
     pretrainset: Vec<FSRSItem>,
     mut trainset: Vec<FSRSItem>,
 ) -> (Vec<FSRSItem>, Vec<FSRSItem>) {
+    if std::env::var("FSRS_NO_OUTLIER").is_ok() {
+        // skip outlier filtering...
+    }
     let mut groups = HashMap::<u32, HashMap<u32, Vec<FSRSItem>>>::new();
 
     // group by rating of first review and delta_t of second review

Then you could set FSRS_NO_OUTLIER=1 when running the benchmark.

@L-M-Sherlock L-M-Sherlock linked a pull request Dec 18, 2023 that will close this issue
@dae dae closed this as completed in #137 Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants