8000 Bayesian priors in nearest neighbors classification/regression · Issue #399 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Bayesian priors in nearest neighbors classification/regression #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jakevdp opened this issue Oct 18, 2011 · 7 comments
Open

Bayesian priors in nearest neighbors classification/regression #399

jakevdp opened this issue Oct 18, 2011 · 7 comments

Comments

@jakevdp
Copy link
Member
jakevdp commented Oct 18, 2011

Currently the classification and regression algorithms in the neighbors module use a flat prior. They should be modified to compute a prior based on training data, and to optionally accept a user-defined prior.

@nikitsaraf
Copy link

I did not understood what to do you mean by Bayesian prior and where is flat prior used in the neighbours module? Please Pardon me,I am relatively new to Machine Learning and scikit-learn.

@jakevdp
Copy link
Member Author
jakevdp commented Jun 14, 2012

If you're doing KNN classification on two classes with unequal sizes (i.e. 1000 foreground objects among 100,000 background objects) then the KNN classifier as written may classify everything as background simply because of the imbalance in numbers. A Bayesian prior would weight the classification based on the relative number of samples, and potentially lead to a better classification. It's similar to the class_prior_ computed in GaussianNB.

@acompa
Copy link
acompa commented Jul 20, 2012

I'm working on this right now during the SciPy sprint.

@jakevdp
Copy link
Member Author
jakevdp commented Jul 20, 2012

There's some work going on for this here as well: #970

@acompa
Copy link
acompa commented Jul 20, 2012

Ack, that looks all but fixed. I'm moving on.

@haiatn
Copy link
Contributor
haiatn commented Jul 29, 2023

Maybe #9597 fixed this? I am not sure

@adrinjalali
Copy link
Member

If somebody wants to fix this, they can check #970 and continue that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
0