question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clearer definition of alpha in KRR

See original GitHub issue

Describe the issue linked to the documentation

In the docs for KRR, it is not especially clear to me what exactly alpha is defined as. When looking at the cited reference in “Machine Learning: A Probabilistic Perspective” (and nearly every other reference for KRR), the expression for the vector of weights is given by w = (KI)^{-1}y. How does alpha relate to λ? As suggested in the docs, alpha is defined as (2*C)^{-1}, so I checked out the documentation for LogisticRegression and found that C is the inverse of the regularization strength. Does that make alpha = (2*1/λ)^{-1} = λ/2?

Suggest a potential alternative/fix

In general, I feel like the documentation for the hyperparameters could be made clearer. In the case of something like KRR especially, where there is a closed-form solution, it would be even better if the equation were included on the page where the arguments clearly correspond to the closed-form solution. Even without this, I still remain confused about what precisely alpha is. A clearer explanation, without directing the reader to other functions, would be helpful.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
NicolasHugcommented, Mar 17, 2020

This is especially confusing because the reference to “Machine Learning: A Probabilistic Perspective” does have an alpha variable in it, but it’s the weights rather than a regularization parameter, making it even more confusing

Sadly, every author has their own convention for naming things. It takes practice and patience to get used to it and switch between conventions. In scikit-learn, we should be concerned about being consistent with ourselves, but we can’t follow the same notation used in every book (because there are so many).

Note that the docstring for alpha was recently updated, to clarify that it’s the regularization parameter and with a link to the forumla. The latest docs are at https://scikit-learn.org/dev/modules/generated/sklearn.kernel_ridge.KernelRidge.html#sklearn.kernel_ridge.KernelRidge

0reactions
NicolasHugcommented, Apr 26, 2020

Thanks both, yes I think the new version is good enough. Closing the issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Alpha: What It Means in Investing, With Examples - Investopedia
Alpha is used in finance as a measure of performance, indicating when a strategy, trader, or portfolio manager has managed to beat the...
Read more >
1.1. Linear Models — scikit-learn 1.2.0 documentation
RidgeCV implements ridge regression with built-in cross-validation of the alpha parameter. The object works in the same way as GridSearchCV except that it ......
Read more >
The Alpha Keto Amide Moiety as a Privileged Motif in ...
(100) Biological assays on zebrafish performed to better define the toxicity profile of these compounds showed no effect on zebrafish ...
Read more >
What Is Alpha in Finance? Definition, Formula & Examples
Alpha is expressed in numeric terms: The higher the alpha number is, the better. For example, a fund with an alpha of 5...
Read more >
State feedback and Observer Feedback
This means that we cannot transform the system into controller canonical form, since otherwise, we can arbitrarily place the eigenvalues.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found