Comments (3)
I'm not sure if this helps with the original problem, but someone might find it useful in the future.
You can pass a callable to GridSearchCV
as the refit
parameter that takes the the dictionary given by the cv_results_
attribute of the GridSearchCV
object and returns the index of the best parameter based on your criteria you define in your function. I used this to implement the "one standard error rule" for ridge regression.
def best_alpha_index(results):
K = len([x for x in list(results.keys()) if x.startswith('split')])
alpha_range = results['param_ridge__alpha'].data
mean_per_alpha = pd.Series(results['mean_test_score'], index = alpha_range)
std_per_alpha = pd.Series(results['std_test_score'], index = alpha_range)
sem_per_alpha = std_per_alpha / np.sqrt(K)
max_score = mean_per_alpha.max()
sem = sem_per_alpha[mean_per_alpha.idxmax()]
best_alpha = mean_per_alpha[mean_per_alpha >= max_score - sem].index.max()
best_alpha_index = int(np.argwhere(alpha_range == best_alpha)[0])
return best_alpha_index
Then used refit = best_alpha_index
when constructing the GridSearchCV
object.
from lightning.
Haven't seen such example, and didn't know about the technique. Feel free
to submit an example if you think it could be useful
On Jun 15, 2016 4:00 PM, "Levi Thatcher" [email protected] wrote:
Love the fact that this package offers group lasso! You're probably aware,
but with Lasso one often uses a cross validation combined with a
one-standard-error (1SE) rule, where one chooses the model with fewest
coefficients that's less than 1SE away from the sub-model with the lowest
error.Is there an example anywhere with your group lasso combined with
cross-validation or any thoughts on implementing the 1SE functionality?
Thanks again for this wonderful resource!—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#84, or mute
the thread
https://github.com/notifications/unsubscribe/AAQ8hyvcta8VbiGvSZuaUw7tUzZrhdUmks5qMFn3gaJpZM4I2vJe
.
from lightning.
Thanks, Fabian! Appreciate all this great work!
On Jun 18, 2016, at 5:06 PM, Fabian Pedregosa [email protected] wrote:
Haven't seen such example, and didn't know about the technique. Feel free
to submit an example if you think it could be useful
On Jun 15, 2016 4:00 PM, "Levi Thatcher" [email protected] wrote:Love the fact that this package offers group lasso! You're probably aware,
but with Lasso one often uses a cross validation combined with a
one-standard-error (1SE) rule, where one chooses the model with fewest
coefficients that's less than 1SE away from the sub-model with the lowest
error.Is there an example anywhere with your group lasso combined with
cross-validation or any thoughts on implementing the 1SE functionality?
Thanks again for this wonderful resource!—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#84, or mute
the thread
https://github.com/notifications/unsubscribe/AAQ8hyvcta8VbiGvSZuaUw7tUzZrhdUmks5qMFn3gaJpZM4I2vJe
.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from lightning.
Related Issues (20)
- Unsafe screening with CDClassifier? HOT 1
- Forgotten intercept in SGDRegressor HOT 2
- ModuleNotFoundError: No module named 'sklearn.externals.six' HOT 4
- How to pip sklearn-contrib-lightning HOT 2
- 2d errors when passing pandas DataFrame/Series
- Nonnegative penalties actually allowed in CDRegressors HOT 3
- FistaRegressor does not converge for real data HOT 3
- build pb on python 3.9 HOT 1
- Change assert imports HOT 2
- do you have Quantile Regression for spars data after one hot transformation
- do you have Regression for spars categorical big data after one hot transformation
- do you have support vector regression with soft margin and confidence interval ?
- do you have implementation for regression with confidence intervals ?
- Does lightning natively support multi-label HOT 1
- DOC: sometimes the Lasso solution is the same as sklearn, sometimes not HOT 5
- install help
- ENH - Add support of intercept in ``SDCARegressor`` HOT 1
- Why not initialize SAG/SAGA memory with 0 and divide by seen indices so far as in sklearn?
- Missing Support for class-weights specifications to tacke Disproportionate Number of Samples between dependent variable classes
- CDClassifier : error for penalty="l1" and penalty="l2", but no error for penalty="l1/l2" HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning.