Skip to content

ENH, TST: Add rtol to classifier and a test.#44

Merged
tylerjereddy merged 1 commit intomainfrom
nray/add_rtol_classifier
Feb 4, 2026
Merged

ENH, TST: Add rtol to classifier and a test.#44
tylerjereddy merged 1 commit intomainfrom
nray/add_rtol_classifier

Conversation

@nray
Copy link
Collaborator

@nray nray commented Feb 4, 2026

Related to gh-12.

@tylerjereddy tylerjereddy added this to the 0.1.0 milestone Feb 4, 2026
@tylerjereddy tylerjereddy added the enhancement New feature or request label Feb 4, 2026
@tylerjereddy
Copy link
Collaborator

I've edited the original comment to note which issue this PR is related to. Usually a short description that includes the connected issue can be helpful. I'll review this now.

Copy link
Collaborator

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @nray. I added a few minor comments you could do in a follow-up, but not worth blocking on.

@eiviani-lanl the regression test and source changes Navamita added here can be used with only minor modification for your classifier with rtol. That should make it pretty easy for you over on the sklearn side. For the regressor, Navamita merged my equivalent changes recently, so you can pull those in as well if you haven't already.

def test_rtol_classifier(reg_alpha, rtol, expected_acc, expected_roc):
# For Moore-Penrose, a large singular value cutoff (rtol)
# may be required to achieve reasonable results. This test
# showcases that a default low cut of leads to almost random classification
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# showcases that a default low cut of leads to almost random classification
# showcases that a default low cut off leads to almost random classification

X_test_s = scaler.transform(X_test)

activation = "softmax"
weight_scheme = "normal"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well just specify the arguments directly in the call to the estimator below, since they're not used for anything else.

Since that's minor, I'll let you do that in a follow-up.

@tylerjereddy tylerjereddy merged commit 602dd47 into main Feb 4, 2026
18 checks passed
@tylerjereddy tylerjereddy deleted the nray/add_rtol_classifier branch February 4, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants