Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
szcf-weiya committed Jan 26, 2018
1 parent 8973117 commit 077f400
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/Prototype/scripts.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## generate dataset
N = 100
16 changes: 16 additions & 0 deletions code/Prototype/sim13_1.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: "R Notebook"
output: html_notebook
---

This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.

Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Ctrl+Shift+Enter*.

```{r}
plot(cars)
```

Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Ctrl+Alt+I*.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Ctrl+Shift+K* to preview the HTML file).
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,23 @@ $$

## 例子: 比较研究

TODO
我们在两个模拟问题中比较了最近邻,k均值和LVQ分类器。有10个独立的特征$X_j$,每个都是[0,1]上的均匀分布。两类别的0-1目标变量由下式子定义:

$$
\begin{align}
Y&=I(X_1\ge \frac 12);\qquad\text{problem 1: "easy"}
Y&=I(\sign\{\prod\limits_{j=1}^3(X_j-\frac 12)\}>0);\qquad \text{problem 2: "difficult"}
\end{align}
\qquad (13.6)
$$

因此在第一个问题中,两个类别被超平面$X_1=\frac 12$分离开;在第二个问题中,两个类别被前三个特征定义的超立体形成了跳棋盘(checkerboard)。这两个问题的贝叶斯误差率都是0。有100个训练观测和100个测试观测。

![](../img/13/fig13.5.png)

图13.5展示了最近邻、K均值和LVQ当调整参数变化的10次实现中的误分类误差的均值和标准误差。我们看到K均值和LVQ给出了几乎相近的结果。在调整参数的最优选择下,K均值和LVQ在第一个问题上都比最近邻要好,并且在第二个问题上它们表现很相似。注意到每个调整参数的最优值在不同情形是不同的。举个例子,在第一个问题中,25最近邻比1最近邻好70%,而在第二个例子中1最近邻比25最近邻好18%。这些结果强调了采用客观的、基于数据的方法的重要性,比如用交叉验证来估计调整参数的最优值(见图13.4和第7章)。



## 例子: k-最近邻和图象分类

Expand Down
1 change: 1 addition & 0 deletions yeti/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
max: "{\\mathrm{max}\\;}",
min: "{\\mathrm{min}\\;}",

sign: "{\\mathrm{sign}}",
df: "{\\mathrm{df}}",
tr: "{\\mathrm{tr}}",

Expand Down

0 comments on commit 077f400

Please sign in to comment.