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

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

avatest™

## avatest™帮您通过考试

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

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

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

Every ML method uses a (more of less explicit) hypothesis space $\mathcal{H}$ which consists of all computationally feasible predictor maps $h$. Which predictor map $h$ out of all the maps in the hypothesis space $\mathcal{H}$ is the best for the ML problem at hand? To answer this questions, ML methods use the concept of a loss function. Formally, a loss function is a map
$$L: \mathcal{X} \times \mathcal{Y} \times \mathcal{H} \rightarrow \mathbb{R}_{+}:((\mathbf{x}, y), h) \mapsto L((\mathbf{x}, y), h)$$
which assigns a pair consisting of a data point, with features $\mathbf{x}$ and label $y$, and a hypothesis $h \in \mathcal{H}$ the non-negative real number $L((\mathbf{x}, y), h)$.

The loss value $L((\mathbf{x}, y), h)$ quantifies the discrepancy between the true label $y$ and the predicted label $h(\mathbf{x})$. A small (close to zero) value $L((\mathbf{x}, y), h)$ indicates a low discrepancy between predicted label and true label of a data point. Figure $2.11$ depicts a loss function for a given data point, with features $\mathbf{x}$ and label $y$, as a function of the hypothesis $h \in \mathcal{H}$. The basic principle of ML methods can then be formulated as: Learn (find) a hypothesis out of a given hypothesis space $\mathcal{H}$ that incurs a minimum loss $L((\mathbf{x}, y), h)$ for any data point (see Chap. 4).

Much like the choice for the hypothesis space $\mathcal{H}$ used in a ML method, also the loss function is a design choice. We will discuss some widely used examples for loss function in Sects. 2.3.1 and 2.3.2. The choice for the loss function should take into account the computational complexity of searching the hypothesis space for a hypothesis with minimum loss. Consider a ML method that uses a hypothesis space parametrized by a weight vector and a loss function that is a convex and differentiable (smooth) function of the weight vector. In this case, searching for a hypothesis with small loss can be done efficiently using the gradient-based methods discussed in Chap. 5. The minimization of a loss function that is either non-convex or non-differentiable is typically computationally much more difficult. Section $4.2$ discusses the computational complexities of different types of loss functions in more detail.

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

For ML problems involving data points with numeric labels $y \in \mathbb{R}$, i.e., for regression problems (see Sect. 2.1.2), a widely used (first) choice for the loss function can be the squared error loss
$$L((\mathbf{x}, y), h):=(y-\underbrace{h(\mathbf{x})}_{=\hat{y}})^2 .$$
The squared error loss (2.8) depends on the features $\mathbf{x}$ only via the predicted label value $\hat{y}=h(\mathbf{x})$. We can evaluate the squared error loss solely using the prediction $h(\mathbf{x})$ and the true label value $y$. Besides the prediction $h(\mathbf{x})$, no other properties of the features $\mathbf{x}$ are required to determine the squared error loss. We will slightly abuse notation and use the shorthand $L(y, \hat{y})$ for any loss function that depends on the features $\mathbf{x}$ only via the predicted label $\hat{y}=h(\mathbf{x})$. Figure $2.13$ depicts the squared error loss as a function of the prediction error $y-\hat{y}$.

The squared error loss $(2.8)$ has appealing computational and statistical properties. For linear predictor maps $h(\mathbf{x})=\mathbf{w}^T \mathbf{x}$, the squared error loss is a convex and differentiable function of the weight vector w. This allows, in turn, to efficiently search for the optimal linear predictor using efficient iterative optimization methods (see Chap. 5). The squared error loss also has a useful interpretation in terms of a probabilistic model for the features and labels. Minimizing the squared error loss is equivalent to maximum likelihood estimation within a linear Gaussian model [28, Sect. 2.6.3].

Another loss function used in regression problems is the absolute error loss $|\hat{y}-y|$. Using this loss function to guide the learning of a predictor results in methods that are robust against few outliers in the training set (see Sect. 3.3). However, this improved robustness comes at the expense of increased computational complexity of minimizing the (non-differentiable) absolute error loss compared to the (differentiable) squared error loss (2.8).

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

$$L: \mathcal{X} \times \mathcal{Y} \times \mathcal{H} \rightarrow \mathbb{R}{+}:((\mathbf{x}, y), h) \mapsto L((\mathbf{x}, y), h)$$ 它分配了一个由数据点组成的对，具有特征 $\mathbf{x}$ 和标签 $y$ ，和一个假设 $h \in \mathcal{H}$ 非负实数 $L((\mathbf{x}, y), h)$. 损失值 $L((\mathbf{x}, y), h)$ 量化真实标签之间的差异 $y$ 和预测的标签 $h(\mathbf{x})$. 一个小（接近于零) 的值 $L((\mathbf{x}, y), h)$ 表示数据点的预测标签 和真实标签之间的差异很小。数字 $2.11$ 描述给定数据点的损失函数，具有特征和标签 $y$, 作为假设的函数 $h \in \mathcal{H}$. ML 方法的基本 原理可以表述为: 从给定的假设空间中学习 (找到) 一个假设 $\mathcal{H}$ 导致最小损失 $L((\mathbf{x}, y), h)$ 对于任何数据点 (见第 4 章)。 很像假设空间的选择 $\mathcal{H}$ 在 ML 方法中使用，损失函数也是一种设计选择。我们将在 Sects 中讨论一些广泛使用的损失函数示例。 2.3.1 和 2.3.2。损失函数的选择应考虑在假设空间中搜索具有最小损失的假设的计算复杂性。考虑一种机器学习方法，该方法使用 由权重向量和损失函数参数化的假设空间，该损失函数是权重向量的凸和可微 (平滑) 函数。在这种情况下，可以使用第 1 章中讨 论的基于梯度的方法有效地㮴索具有小损失的假设。 5 . 非凸或不可微的损失函数的最小化通常在计算上要困难得多。部分 $4.2$ 更详 细地讨论了不同类型损失函数的计算复杂性。

## MATLAB代写

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