Notes 2 : Probability Distribution

by Haicang

Nonparametric Methods

Histogram

A general formula

For a certain region R R , the probability of points fall in R is P P , and the number of points in region R is K=NP K = N P . The formula of probability density is as follows:

p(x)=KNV(5.1) (5.1) p ( x ) = K N V

Here, K K is the number of points fall in the region, N is the number of the total points, while V V is the volume of the current region.

So there are two ways to estimate p(x). One is to fix V V , the volume and change K (Kernel method), while the other is vice versa, namely fix K K , the number of points and vary V the volume (Nearest-Neighbors). With N N → ∞ density from the two methods, both will converge to the true distribution.

Kernel density estimators

Use k(u) k ( u ) to denote a certain kernel function. There are some constraints:

k(u)0k(u)du=1 k ( u ) ≤ 0 ∫ k ( u ) d u = 1

k(u) k ( u ) is like a pdf(probability density function).

then K K in (5.1) is as follow:

(5.2)K=n=1Nk(xxnh)

Substituting this expression into (5.1), we get

p(x)=1N1VKernel(5.3) (5.3) p ( x ) = 1 N 1 V ⋅ K e r n e l

But there remains something I have to make sure.

h h is a smoothing parameter. There is a tradeoff between sensitivity to noise at small h and over-smoothing at large h h .

Nearest-neighbor methods

Considering a small sphere centered on the point x, we want to estimate density p(x p ( x . Then we allow the sphere to grow until it contains K K data points. K is also a smoothing parameter to trade-off. A large K K can cause over-smoothing, while a small K suffers from noise. Model produced by KNN is not a true density model because the integral over all space diverges.

KNN classifier For a point x x , it’s label will be the the most frequent label in it’s KNN. As before, K K is also a smoothing parameter. This can be derived from the conditional probability version of (5.1), and then comes the intuitive result.

(5.4)p(Ck|x)=KkK

Where, K K is the number of total points in the region, while Kk is the number of points labeled k k in the same region.

KNN is very quick in learning (Some one says it’s not really learning), while the prediction process is very slow compared with over method. But an interesting property is that, when N, the error rate is never more than twice the minimum Bayes error, which thought to be the lower bound of the mismatch of a machine learning algorithm.

The sci-kit learning link of KNN can be found here.


[1] Bishop. Pattern Recognition and Machine Learning

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值