Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

clean up n_jobs warning#44

Merged
martinfleis merged 2 commits intopysal:mainfrom
jGaboardi:n_jobs_warning
Dec 30, 2025
Merged

clean up n_jobs warning#44
martinfleis merged 2 commits intopysal:mainfrom
jGaboardi:n_jobs_warning

Conversation

@jGaboardi
Copy link
Member

@jGaboardi jGaboardi commented Dec 30, 2025

This PR addresses the FutureWarning being thrown when passing n_jobs into model

/home/runner/micromamba/envs/py314-latest/lib/python3.14/site-packages/sklearn/linear_model/_logistic.py:1184: FutureWarning: 'n_jobs' has no effect since 1.8 and will be removed in 1.10. You provided 'n_jobs=-1', please leave it unspecified.
    warnings.warn(msg, category=FutureWarning)

@jGaboardi jGaboardi self-assigned this Dec 30, 2025
@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@2f5c5cb). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #44   +/-   ##
=======================================
  Coverage        ?   85.40%           
=======================================
  Files           ?        6           
  Lines           ?      651           
  Branches        ?        0           
=======================================
  Hits            ?      556           
  Misses          ?       95           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jGaboardi jGaboardi marked this pull request as ready for review December 30, 2025 02:44
Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

The warning is thrown by logistic regression only. We shall pass the keyword to all the other models where this is a valid keyword. That is why the inspect exists. Once it is removed in sklearn 1.10, we won't be passing it any longer. I'd say we should just suppress the warning here as the code is ready for the deprecation.

@martinfleis
Copy link
Member

Regarding the rest, it is mostly the same warning. We should find where it happens and cast those numpy arrays to data frames with proper column names.

@jGaboardi
Copy link
Member Author

The warning is thrown by logistic regression only. We shall pass the keyword to all the other models where this is a valid keyword. That is why the inspect exists. Once it is removed in sklearn 1.10, we won't be passing it any longer. I'd say we should just suppress the warning here as the code is ready for the deprecation.

So basically just a warning suppression right here it what we are looking for, correct?

@martinfleis
Copy link
Member

I believe so. Or we can check if self.model is LogisticRegression but I'd like to avoid model-specific code this deep.

@jGaboardi
Copy link
Member Author

The warning was actually being thrown from the fit() call

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinfleis martinfleis merged commit 2d547ff into pysal:main Dec 30, 2025
14 checks passed
@jGaboardi jGaboardi deleted the n_jobs_warning branch December 30, 2025 19:06
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