Skip to content

Optimise PC regression - #408

Merged
mumichae merged 28 commits into
mainfrom
optimise_pcr
Dec 20, 2024
Merged

mumichae merged 28 commits into
mainfrom
optimise_pcr

Conversation

@mumichae

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov

codecov Bot commented Apr 22, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 86.15385% with 9 lines in your changes missing coverage. Please review.

Project coverage is 58.93%. Comparing base (d357273) to head (c54ad5c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
scib/metrics/pcr.py 84.48% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
+ Coverage   58.01%   58.93%   +0.91%     
==========================================
  Files          22       22              
  Lines        1646     1690      +44     
==========================================
+ Hits          955      996      +41     
- Misses        691      694       +3     
Flag Coverage Δ
unittests 58.93% <86.15%> (+0.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scib/metrics/cell_cycle.py 89.58% <100.00%> (+0.22%) ⬆️
scib/preprocessing.py 19.06% <100.00%> (ø)
scib/metrics/pcr.py 85.71% <84.48%> (+4.55%) ⬆️
🚀 New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mumichae
mumichae requested a review from VladimirShitov April 24, 2024 12:56

@VladimirShitov VladimirShitov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall, looks super nice. Sometimes, the code is unclear. I left some comments on potential improvements :)

Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/pcr.py Resolved
Comment thread tests/metrics/test_pcr_metrics.py Resolved

@VladimirShitov VladimirShitov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great to me :)

@VladimirShitov VladimirShitov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good in general :) I left a few questions

Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/cell_cycle.py Resolved

@mumichae mumichae left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I addressed your comments, but only changed the linear regression part to use multiple regression. According to my tests the output is sufficiently similar

Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/pcr.py Resolved
Comment thread scib/metrics/cell_cycle.py Resolved
@mumichae
mumichae merged commit e614d35 into main Dec 20, 2024
@mumichae
mumichae deleted the optimise_pcr branch December 20, 2024 18:45
barlowa124 pushed a commit to barlowa124/scib that referenced this pull request Dec 4, 2026
* add numpy linreg function and use in pcr

* allow configuring linreg method for pcr methods

* simplify numpy linreg function

* add tests for different linreg implementations

* set PCA recomputation to False by default

* use multithreading for linear regression and add tdqm

* add durations to test command

* add durations flag to pytest command

* add min duration flag

* add comments for ThreadPoolExecutore run

* allow to specify n_threads and linreg algorithm

* add keywords to cell cycle scoring

* add multiple threading in pcr test

* use nanmean

* test cell cycle score with numpy linreg

* use more memory-efficient implementation of ThreadPool

* fix cases where there are no residuals

* allow to configure svd_solver

* use multiple linear regression and remove multithreading approach

* use pcr score from numpy exact OLS implementation

* remove testing code

* include old pcr implementation

* Update scib/metrics/cell_cycle.py

* change default to numpy
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.

2 participants