Skip to content

Update to Optim@2 - #182

Open
devmotion wants to merge 2 commits into
JuliaAI:devfrom
devmotion:dmw/optim2
Open

Update to Optim@2#182
devmotion wants to merge 2 commits into
JuliaAI:devfrom
devmotion:dmw/optim2

Conversation

@devmotion

Copy link
Copy Markdown

Fixes #177.

@ablaom

ablaom commented Jul 30, 2026

Copy link
Copy Markdown
Member

Thanks @devmotion for drafting this fix - very much appreciated.

Current fail is:

HuberReg: Test Failed at /home/runner/work/MLJLinearModels.jl/MLJLinearModels.jl/test/fit/robust.jl:57
    Expression: isapprox(J(θ_newton), 6.200183, rtol = 1.0e-5)
     Evaluated: isapprox(6.200521473589882, 6.200183; rtol = 1.0e-5)

The relevant test code is here

I can't really comment here as I don't understand where the reference value "6.200183" is coming from. There is a code comment that says "in these cases, if available, θ_newton is used as reference" but I don't follow, as θ_newton is computed but not apparently not used as the reference value. So where exactly does ""6.200183" come from?

@tlienart Great if you could clarify here.

@tlienart

tlienart commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

these values were reference values taken from fixed runs from sklearn, you can safely adjust the relative tolerance, I did have to play a bit with tolerances back in the days, effectively the aim here is to have something that's "close enough" but it doesn't have to be identical because the approaches are not the same.

@ablaom

ablaom commented Jul 30, 2026

Copy link
Copy Markdown
Member

@tlienart Thanks for that lightning response and clarification.

@devmotion I think you can go ahead and relax the tolerance. Can you also please add a code comment top of file to the effect that the reference values come from sklearn?

@devmotion
devmotion marked this pull request as ready for review July 31, 2026 07:16
@devmotion

Copy link
Copy Markdown
Author

I updated the comment and the tests

@tlienart

tlienart commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

On second thoughts it might not have been a sklearn comparison but an optimizer comparison (it's been a while) but the conclusion is identical.

Thanks for your work guys!

@ablaom

ablaom commented Aug 3, 2026

Copy link
Copy Markdown
Member

On second thoughts it might not have been a sklearn comparison but an optimizer comparison

@tlienart Could you please elaborate? I still don't understand what exactly you mean here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optim.jl 2 update

3 participants