mne-tools / mne-tools/mne-python

BUG..?: linear_regression_raw doesn't warn for rank deficiency

Open
#2,782 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Passing predictors that will lead to a rank deficient matrix to linear_regression_raw should throw an error or at least a big fat warning. Currently, it silently computes a stupid solution.
This is in my experience a very common scenario.

An extremely easy way may be checking the rank of the resulting predictor matrix.

(It would also be nice to estimate the degree of multicollinearity in the model.)

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 at the linear_regression_raw entry point and reproduce the issue with predictors that produce a rank-deficient matrix. Review the surrounding behavior and existing tests to determine whether the expected result should be an error or a prominent warning. Done means rank-deficient input no longer silently produces a solution, with coverage for the selected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.