> For the complete documentation index, see [llms.txt](https://windmising.gitbook.io/lihang-tongjixuexifangfa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://windmising.gitbook.io/lihang-tongjixuexifangfa/smo/16.md).

# 选择变量

## 选择$$a\_1$$

目标：选择违反KKT最严重的点

**KKT条件**:

* 位于间隔边界外的点：$$a\_i=0 \Leftrightarrow y\_ig(x\_i) \ge 1$$ &#x20;
* 位于间隔边界上的点：$$0 \lt a\_i \lt C=0 \Leftrightarrow y\_ig(x\_i) = 1$$ &#x20;
* 位于间隔边界内的点：$$a\_i = C \Leftrightarrow y\_ig(x\_i) \le 1$$   &#x20;

其中：

$$
g(x\_i) = \sum\_{j=1}^Na\_jy\_jK(x\_i, x\_j) + b
$$

$$g(x\_i)$$代表对$$x\_i$$的预测结果。

1. 满足$$0 \lt a\_i \lt C=0$$的样本点（即位于间隔边界上的点）中寻找违反KKT最严重的点。 &#x20;
2. 所有点中违反KKT最严重的点。 &#x20;

## 选择$$a\_2$$

此时已找到$$a\_1$$\
目标：选择使a\_2有足够大变化的点

1. 如果$$E\_1 \gt 0$$，选择最小的Ei对应的a2， &#x20;

   如果$$E\_1 \lt 0$$，选择最大的Ei对应的a2， &#x20;
2. 遍历位于间隔边界外的点，找到使目标函数有足够下降的样本 &#x20;
3. 遍历所有数据集，找到使目标函数有足够下降的样本   &#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://windmising.gitbook.io/lihang-tongjixuexifangfa/smo/16.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
