Quantco / Quantco/glum

Tiny mismatch in CD and IRLS convergence criteria

Open
#423 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
386
Forks
36
Avg merge
23h 24m
Merged PRs (30d)
2

Description

See below. The IRLS solver warns that it failed to converge with the one iteration it was allowed. It's only allowed one iteration because this is a Gaussian problem so the quadratic approximation should be exact.
Looking at the convergence column in the output (0.000100) it seems that coordinate descent is exiting just a little bit earlier than it should. I think the problem is that the convergence criterion in the IRLS solver is slightly different than the convergence criterion in CD.

I don't think this is a big problem and I don't intend to work on it now but I just wanted to document it.

(quantcore.glm) ➜  quantcore.glm git:(benchmarks_figure) ✗ glm_benchmarks_run --threads 6 --num_rows 500000 --storage sparse --problem_name interme
diate-insurance-no-weights-lasso-gaussian --library_name quantcore-glm
running problem=intermediate-insurance-no-weights-lasso-gaussian library=quantcore-glm
/home/tbent/Dropbox/active/quantco/quantcore.glm/src/quantcore/glm/_solvers.py:348: ConvergenceWarning: IRLS failed to converge. Increase the maxim
um number of iterations max_iter (currently 1)
  warnings.warn(
Diagnostics:
        convergence  n_cycles  iteration_runtime   intercept
n_iter                                                      
0       2911.900983         0           0.119170  1842.74569
1          0.000100     25576           0.896123  1842.74569
ran problem intermediate-insurance-no-weights-lasso-gaussian with library quantcore-glm
ran in 1.0402872562408447

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/quantcore/glm/_solvers.py around line 348, where the IRLS convergence warning is emitted. Compare the IRLS and coordinate-descent convergence criteria and reproduce the Gaussian benchmark shown in the report. Done means the criteria agree for this case and the single allowed IRLS iteration no longer produces a misleading convergence warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.