Skip to content

Commit c3d685f

Browse files
committed
Pre-submission
1 parent a819664 commit c3d685f

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# genderBR 1.4.0
22

3-
This is a new version that introduces one important new feature: asymmetrical thresholds for gender classification. In the previous versions, users could set a single threshold to classify names as female or male -- and they could overlap if the threshold was too low. Now, users can set a different threshold for each sex, and there is a new check to prevent overlapping thresholds. The release also includes other improvements and bug fixes.
3+
This is a new version that introduces a new feature: asymmetrical thresholds for gender classification. In the previous versions, users could set a single threshold to classify names as female or male -- and they could overlap if the threshold was too low. Now, users can set a different threshold for each sex, and there is a new check to prevent overlapping thresholds. The release also includes other improvements and bug fixes.
44

55
- The `threshold` argument of `get_gender()` and `get_gender_nn()` now accepts a vector with two values, allowing users to set a different threshold for each sex: the first value is used to classify females and the second, males (e.g., `threshold = c(0.9, 0.8)`). The two values can also be named, in any order (`c(Female = 0.9, Male = 0.8)` or `c(F = 0.9, M = 0.8)`). A single value keeps setting a symmetrical threshold, as before.
66
- Thresholds that sum to less than 1 are now rejected with an informative error. These values make the female and male bands overlap, so a name could be classified as both. This also applies to a single `threshold` below 0.5, which was silently accepted before and gave inconsistent results between `get_gender()` and `get_gender_nn()`.
@@ -50,7 +50,7 @@ In this minor release, the genderBR package was improved in two ways. First, bug
5050
* Added a `NEWS.md` file to track changes to the package.
5151
* Added input checks to the `get_gender` function.
5252
* Reduce the time between requests to the IBGE's Census API.
53-
* Fixed a problem on vectorization in the internal `round_guess` funcion.
53+
* Fixed a problem on vectorization in the internal `round_guess` function.
5454
* Included an internal dataset with all Brazilian first names and their predicted gender extracted from the IBGE.
5555
* Update the `get_gender` function to work with internal data.
5656

cran-comments.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1-
This is a new version of the package that introduces a new method for predicting gender from Brazilian first names using a neural network model. In addition, this version includes some updates to the documentation, code improvements, and several new tests.
1+
This is a new version (1.4.0) that introduces asymmetrical thresholds for
2+
gender classification: users can now set a different threshold for each sex
3+
in `get_gender()` and `get_gender_nn()` (e.g., `threshold = c(0.9, 0.8)`),
4+
and threshold combinations that would make the female and male bands overlap
5+
are now rejected with an informative error. The release also adds a
6+
`nn_size` argument to split large inputs into batches, a `device` argument
7+
to run neural network inference on a GPU (`cuda` or `mps`), fixes a
8+
vocabulary mismatch in the neural network character encoder (`<UNK>` vs
9+
`<PAD>`), and moves `torch` from `Imports` to `Suggests` -- the neural
10+
network model is now built only when the NN backend is actually used, and a
11+
clear message tells users to install `torch` when it is missing. See
12+
NEWS.md for full details.
13+
14+
Note on file downloads: `download_gender_model()` downloads pre-trained
15+
model weights from Hugging Face to `tools::R_user_dir("genderBR", "cache")`.
16+
This happens only on explicit user request, never at load or install time,
17+
and the corresponding examples are wrapped in `\dontrun{}` so R CMD check
18+
does not trigger it.
219

320
## Test environments
421

5-
* macOS Tahoe 26.3 (personal computer), R 4.5.3
6-
* Fedora 43 (personal computer), R 4.5.3
22+
* macOS Tahoe 26.5.1 (personal computer), R 4.5.3
23+
* Fedora 44 (personal computer), R 4.6.1
724
* GitHub Actions - (ubuntu): release, devel, oldrel-1
825
* GitHub Actions - (windows-latest): release
926
* GitHub Actions - (macOS-latest): release
1027
* Winbuilder - (windows server 2022): release, devel
1128

1229
## R CMD check results
1330

14-
0 errors | 0 warnings | 0 note
31+
0 errors | 0 warnings | 0 notes
1532

1633
## Reverse dependencies
1734

0 commit comments

Comments
 (0)