Skip to content

Commit

Permalink
Fix/inconsistent outlier filter (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock authored Apr 21, 2024
1 parent 37ece5e commit 17d6aef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "FSRS-Optimizer"
version = "4.28.0"
version = "4.28.1"
readme = "README.md"
dependencies = [
"matplotlib>=3.7.0",
Expand Down
5 changes: 3 additions & 2 deletions src/fsrs_optimizer/fsrs_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,12 @@ def remove_outliers(group: pd.DataFrame) -> pd.DataFrame:
count = grouped_group.loc[i, ("y", "count")]
delta_t = grouped_group.loc[i, "delta_t"].values[0]
if has_been_removed + count >= max(total * 0.05, 20):
break
else:
if count < 6 or delta_t > (100 if group.name[0] != "4" else 365):
group.drop(group[group["delta_t"] == delta_t].index, inplace=True)
has_been_removed += count
else:
group.drop(group[group["delta_t"] == delta_t].index, inplace=True)
has_been_removed += count
return group


Expand Down

0 comments on commit 17d6aef

Please sign in to comment.