Skip to content

Implement the parzenwindow, which is the experiment 1 in Pattern Recognition.(Harbin Institute of Technology, CS, Master)

Notifications You must be signed in to change notification settings

HuiyanWen/ParzenWindow-PR_Experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParzenWindow-PR_Experiment

Implement the parzenwindow, which is the experiment 1 in Pattern Recognition.(Harbin Institute of Technology, CS, Master). I've read a few ParzenWindow samples which realized by Python, but none of them are correct, so I spend three days in understanding and programing it. Hope it'll help you:)

Formula

The implementation strictly follow the "Pattern Classification second edition". Specifically, the references are in page 138, it is as follows:

Loading failed

The flowchart of ParzenWindow

Loading failed

Code illustration

方法名 所属文件 功能
generateDate parzen_main.py 生成样本
ShowData parzen_main.py 绘制样本点
dist parzen_main.py 计算L2距离
gaussCore parzen_main.py 高斯核函数
ShowData parzen_main.py 绘制样本点
PN parzen_main.py 绘制样本点
ShowData parzen_main.py Pn公式计算
calculate_acc parzen_main.py 准确率计算
calculate_acc parzen_main.py 样本点预测
main parzen_main.py 主函数
calc_statistics initia_distribution.py 核对方差、均值
main initia_distribution.py 绘制初始分布

Expriments and results

We let test samples' num stay 300 during the whole lab, and adjust the training num N and window sizeh.

initial distribution
the left is the test set, the other is the train set.
N=30 h=0.5 accuracy=0.5367
The tint dots are test samples' inference result, you can see most of them are around the corresponding train samples, and this phenomenon illustrates we are right.
N=30 h=1 accuracy=0.4233
N=30 h=5 accuracy=0.3333
N=90 h=0.5 accuracy=0.56
N=90 h=1 accuracy=0.4667
N=90 h=5 accuracy=0.3333
N=300 h=0.5 accuracy=0.6
N=300 h=1 accuracy=0.5367
N=300 h=5 accuracy=0.5367
N=1200 h=0.5 accuracy=0.6667
N=1200 h=1 accuracy=0.5667
N=1200 h=5 accuracy=0.3833
Set N=1200, the accuracy changes with h.

About

Implement the parzenwindow, which is the experiment 1 in Pattern Recognition.(Harbin Institute of Technology, CS, Master)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages