Skip to content

Commit 1f2e7bc

Browse files
authored
Merge pull request #498 from JuliaTrustworthyAI/497-bug-in-train_test_split-function
fixed
2 parents 3a8cdc3 + 5597c7a commit 1f2e7bc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1010

1111
### Changed
1212

13-
- Slight changes to the implementation of `ProbeGenerator` (no longer calling a redundant `hinge_loss` function for all other generators).
13+
- Addressed bug in `train_test_split` function. [#497]
14+
- Slight changes to the implementation of `ProbeGenerator` (no longer calling a redundant `hinge_loss` function for all other generators). [#492]
1415

1516
### Added
1617

17-
- Added a warning message to the `ProbeGenerator` pointing to the issues with with current implementation.
18-
- Added links to papers to all docstrings for generators.
18+
- Added a warning message to the `ProbeGenerator` pointing to the issues with with current implementation. [#492]
19+
- Added links to papers to all docstrings for generators. [#492]
1920

2021
## Version [1.3.5] - 2024-10-28
2122

src/data_preprocessing/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function train_test_split(data::CounterfactualData; test_size=0.2, keep_class_ra
4545
class_samples = [
4646
sample(
4747
findall(vec(y .== cls)),
48-
Int(floor(test_size * cls_ratio * n_per_class));
48+
Int(floor(test_size * cls_ratio * N));
4949
replace=false,
5050
) for (cls, cls_ratio) in zip(classes_, class_ratios)
5151
]

0 commit comments

Comments
 (0)