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

[BUG] baccuracy()-function returns NA 🤦‍♀️ #24

Closed
serkor1 opened this issue Dec 21, 2024 · 0 comments · Fixed by #25
Closed

[BUG] baccuracy()-function returns NA 🤦‍♀️ #24

serkor1 opened this issue Dec 21, 2024 · 0 comments · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@serkor1
Copy link
Owner

serkor1 commented Dec 21, 2024

issue

In imbalanced classification problems baccuracy()-function can potentially return NA

source of bug

https://github.com/serkor1/SLmetrics/blob/a90db17b48fcbae74a857afe5b0f53faaf7a1f97/src/classification_BalancedAccuracy.h#L29C9-L43C70

If one of the rows are 0, the entire metric is going to be NA

fix

A similar solution to this:

https://github.com/serkor1/SLmetrics/blob/a90db17b48fcbae74a857afe5b0f53faaf7a1f97/src/classification_Helpers.h#L39C1-L55C2

@serkor1 serkor1 added the bug Something isn't working label Dec 21, 2024
@serkor1 serkor1 self-assigned this Dec 21, 2024
serkor1 added a commit that referenced this issue Dec 21, 2024
* Added `na.rm`-argument that divides and adjust by number of valid classes if TRUE.
* Adjusted by (1-p) and not (p)
* Updated `baccuracy()`-functiotn documentation
* Fixed a bug in the unit-test for `baccuracy()` where adjust flags werent passed correctly.
@serkor1 serkor1 linked a pull request Dec 21, 2024 that will close this issue
serkor1 added a commit that referenced this issue Dec 21, 2024
* [BUG-FIX] See issue #23 🔨

* Fixed a bug in `fbeta()`-unit test where `micro`-flags werent passed correctly.
* Fixed a bug in `fbeta()`-function where `micro`-flags werent passed correctly to header file.
* Simplified F Beta Score calculation
* Switched from np.nan to 0 in {scikit-learn} implementation. np.nan were too inconsistent.
* Replaced all NaNs with 0 in the unit-tests

* [BUG-FIX] See Issue #24

* Added `na.rm`-argument that divides and adjust by number of valid classes if TRUE.
* Adjusted by (1-p) and not (p)
* Updated `baccuracy()`-functiotn documentation
* Fixed a bug in the unit-test for `baccuracy()` where adjust flags werent passed correctly.

* [BUG-FIX] `RRMSE()`-function replaced 🚑

* This function was supposed to be the Relative Root Squared Error. See https://www.gepsoft.com/GeneXproTools/AnalysesAndComputations/MeasuresOfFit/RootRelativeSquaredError.htm

* [BUG-FIX] See commit message 📚

* Unit-tests for generic classification functions werent passing micro flags correctly. These have been fixed.
* The `rae()`-function was calculting means, but it should have calculated and compared sums. This has been fixed
* Update documentation for `rrse()`
* Switched expectation function for matrices in S3 unit-tests; as.table removes all 0 entries so set_equal cant be used.


* [DOCUMENTATION] NEWS updated 📚
@serkor1 serkor1 closed this as completed Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant