Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
182 views
in Technique[技术] by (71.8m points)

python 3.x - Why does sklearn RidgeCV not have an n_jobs argument?

Why does sklearn's RidgeCV not have n_jobs as an argument? LassoCV and LogisticRegressionCV both have it as an argument.

question from:https://stackoverflow.com/questions/65878218/why-does-sklearn-ridgecv-not-have-an-n-jobs-argument

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The premise is that mine is just an educated guess; as you can see here there's an ongoing attempt to enrich the documentation related to the use of n_jobs.

Nevertheless, the answer might be found in what is written in the docs for cross-validation estimators:

Some example of cross-validation estimators are ElasticNetCV and LogisticRegressionCV. Cross-validation estimators are named EstimatorCV and tend to be roughly equivalent to GridSearchCV(Estimator(), ...). The advantage of using a cross-validation estimator over the canonical estimator class along with grid search is that they can take advantage of warm-starting by reusing precomputed results in the previous steps of the cross-validation process. This generally leads to speed improvements. An exception is the RidgeCV class, which can instead perform efficient Leave-One-Out CV.

Basically, the use of RidgeCV slightly differs from the use of the other cross-validation estimators (among which, for instance, LogisticRegressionCV, LassoCV, ElasticNetCV).

  • the former (whenever used with default cv=None) implements Ridge regression with built-in Leave-one-out Cross-Validation; whenever cv is not None, instead, it implements GridSearchCV(Ridge()) with default n_jobs=None.
  • the latter ones do implement more standard cv-strategies with the advantages described above with respect to the use of GridSearchCV(Estimator()).

Eventually, some other useful information might be found in this recent thread.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...