Posted on Categories:CS代写, Machine Learning, 机器学习, 计算机代写

# 计算机代写|机器学习代写Machine Learning代考|Slack Variables for Non-Separable Datasets

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 计算机代写|机器学习代写Machine Learning代考|Slack Variables for Non-Separable Datasets

Many datasets will not be linearly separable. As a result, there will be no way to satisfy all the constraints in Eqn. (463). One way to cope with such datasets and still learn useful classifiers is to loosen some of the constraints by introducing slack variables.

Slack variables are introduced to allow certain constraint to be violated. That is, certain training points will be allowed to be within the margin. We want the number of points within the margin to be as small as possible, and of course we want their penetration of the margin to be as small as possible. To this end, we introduce a slack variable $\xi_i$, one for each datapoint $i$. ( $\xi$ is the Greek letter xi, pronounced “ksi.”). The slack variable is introduced into the optmization problem in two ways. First, the slack variable $\xi_i$ dictates the degree to which the constraint on the $i$ th datapoint can be violated. Second, by adding the slack variable to the energy function we are aiming to simultaneously minimize the use of the slack variables.
Mathematically, the new optimization problem can be expressed as
$$\min {\mathbf{w}, b, \xi{1: N}} \sum_i \xi_i+\lambda \frac{1}{2}|\mathbf{w}|^2$$
such that, for all $i, y_i\left(\mathbf{w}^T \phi\left(\mathbf{x}_i\right)+b\right) \geq 1-\xi_i$ and $\xi_i \geq 0$
As discussed above, we aim to both maximize the margin and minimize violation of the margin constraints. This objective function is still a QP, and so can be optimized with a QP library. However, it does have a much larger number of optimization variables, namely, one $\xi$ must now be optimized for each datapoint. In practice, SVMs are normally optimized with special-purpose optimization procedures designed specifically for SVMs.

## 计算机代写|机器学习代写Machine Learning代考|Loss Functions

In order to better understand the behavior of SVMs, and how they compare to other methods, we will analyze them in terms of their loss functions. ${ }^9$ In some cases, this loss function might come from the problem being solved: for example, we might pay a certain dollar amount if we incorrectly classify a vector, and the penalty for a false positive might be very different for the penalty for a false negative. The rewards and losses due to correct and incorrect classification depend on the particular problem being optimized. Here, we will simply attempt to minimize the total number of classification errors, using a penalty is called the 0-1 Loss:
$$L_{0-1}(\mathbf{x}, y)= \begin{cases}1 & y f(\mathbf{x})<0 \\ 0 & \text { otherwise }\end{cases}$$ (Note that $y f(\mathbf{x})>0$ is the same as requiring that $y$ and $f(\mathbf{x})$ have the same sign.) This loss function says that we pay a penalty of 1 when we misclassify a new input, and a penalty of zero if we classify it correctly.

Ideally, we would choose the classifier to minimize the loss over the new test data that we are given; of course, we don’t know the true labels, and instead we optimize the following surrogate objective function over the training data:
$$E(\mathbf{w})=\sum_i L\left(\mathbf{x}_i, y_i\right)+\lambda R(\mathbf{w})$$

where $R(\mathbf{w})$ is a regularizer meant to prevent overfitting (and thus improve performance on future data). The basic assumption is that loss on the training set should correspond to loss on the test set. If we can get the classifier to have small loss on the training data, while also being smooth, then the loss we pay on new data ought to not be too big either. This optimization framework is equivalent to MAP estimation as discussed previousl ${ }^{10}$; however, here we are not at all concerned with probabilities. We only care about whether the classifier gets the right answers or not.

Unfortunately, optimizing a classifier for the 0-1 loss is very difficult: it is not differentiable everywhere, and, where it is differentiable, the gradient is zero everywhere. There are a set of algorithms called Perceptron Learning which attempt to do this; of these, the Voted Perceptron algorithm is considered one of the best. However, these methods are somewhat complex to analyze and we will not discuss them further. Instead, we will use other loss functions that approximate $0-1$ loss.

## 计算机代写|机器学习代写Machine Learning代考|Slack Variables for Non-Separable Datasets

$$\min \mathbf{w}, b, \xi 1: N \sum_i \xi_i+\lambda \frac{1}{2}|\mathbf{w}|^2$$

## 计算机代写|机器学习代写Machine Learning代考|Loss Functions

$$L_{0-1}(\mathbf{x}, y)=\left{\begin{array}{lc} 1 & y f(\mathbf{x})<0 \\ 0 & \text { otherwise } \end{array}\right.$$ (注意 $y f(\mathbf{x})>0$ 与要求相同 $y$ 和 $f(\mathbf{x})$ 具有相同的符号。) 这个损失函数表示当我们错误分类新输入时我们支 付 1 的惩罚，如果我们正确分类它则支付 0 的怎罚。

$$E(\mathbf{w})=\sum_i L\left(\mathbf{x}_i, y_i\right)+\lambda R(\mathbf{w})$$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。