Skip to content

Commit

Permalink
Fix/Don't remove rows with mean R = 1 (#70)
Browse files Browse the repository at this point in the history
* Don't remove rows with mean R = 1

* More rigorous outlier filter

* Update pyproject.toml

---------

Co-authored-by: Jarrett Ye <[email protected]>
  • Loading branch information
user1823 and L-M-Sherlock authored Dec 26, 2023
1 parent 267e66d commit 84f3d15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 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.20.3"
version = "4.20.4"
readme = "README.md"
dependencies = [
"matplotlib>=3.7.0",
Expand Down
5 changes: 2 additions & 3 deletions src/fsrs_optimizer/fsrs_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,13 @@ def remove_outliers(group: pd.DataFrame) -> pd.DataFrame:
has_been_removed = 0
for i in sort_index:
count = grouped_group.loc[i, ("y", "count")]
if has_been_removed + count >= total * 0.05:
if has_been_removed + count >= max(total * 0.05, 20):
break
has_been_removed += count
group = group[
group["delta_t"].isin(
grouped_group[
(grouped_group[("y", "count")] >= count)
& (grouped_group[("y", "mean")] < 1)
(grouped_group[("y", "count")] >= max(count, 6))
]["delta_t"]
)
]
Expand Down

0 comments on commit 84f3d15

Please sign in to comment.