# 计算机代写|机器学习代写Machine Learning代考|COMP4702 ERM for Linear Regression

my-assignmentexpert™提供最专业的一站式服务：Essay代写，Dissertation代写，Assignment代写，Paper代写，Proposal代写，Proposal代写，Literature Review代写，Online Course，Exam代考等等。my-assignmentexpert™专注为留学生提供Essay代写服务，拥有各个专业的博硕教师团队帮您代写，免费修改及辅导，保证成果完成的效率和质量。同时有多家检测平台帐号，包括Turnitin高级账户，检测论文不会留痕，写好后检测修改，放心可靠，经得起任何考验！

## 计算机代写|机器学习代写Machine Learning代考|ERM for Linear Regression

As discussed in Sect. 3.1, linear regression methods learn a linear hypothesis $h^{(\mathbf{w})}(\mathbf{x})=\mathbf{w}^T \mathbf{x}$ with minimum squared error loss (2.8). For linear regression, the empirical risk minimization problem (4.4) becomes
\begin{aligned} &\widehat{\mathbf{w}}=\underset{\mathbf{w} \in \mathbb{R}^n}{\operatorname{argmin}} f(\mathbf{w}) \ &\text { with } f(\mathbf{w}):=(1 / m) \sum_{(\mathbf{x}, y) \in \mathcal{D}}\left(y-\mathbf{x}^T \mathbf{w}\right)^2 . \end{aligned}
Here, $m=|\mathcal{D}|$ denotes the (sample-) size of the training set $\mathcal{D}$. The objective function $f(w)$ in (4.5) is computationally appealing since it is a convex and smooth function. Such a function can be minimized efficiently using the gradient-based methods discussed in Chap. 5.

We can rewrite the empirical risk minimization problem (4.5) more concisely by stacking the labels $y^{(i)}$ and feature vectors $\mathbf{x}^{(i)}$, for $i=1, \ldots, m$, into a “label vector” $\mathbf{y}$ and “feature matrix” $\mathbf{X}$,
\begin{aligned} &\mathbf{y}=\left(y^{(1)}, \ldots, y^{(m)}\right)^T \in \mathbb{R}^m, \text { and } \ &\mathbf{X}=\left(\mathbf{x}^{(1)}, \ldots, \mathbf{x}^{(m)}\right)^T \in \mathbb{R}^{m \times n} \end{aligned}
This allows us to rewrite the objective function in (4.5) as
$$f(\mathbf{w})=(1 / m)|\mathbf{y}-\mathbf{X} \mathbf{w}|_2^2$$

## 计算机代写|机器学习代写Machine Learning代考|ERM for Decision Trees

Consider empirical risk minimization (4.3) for a regression problem with label space $\mathcal{Y}=\mathbb{R}$ and feature space $\mathcal{X}=\mathbb{R}^n$ and the hypothesis space defined by decision trees (see Sect. 3.10). In stark contrast to empirical risk minimization for linear regression or logistic regression, empirical risk minimization for decision trees amounts to a discrete optimization problem. Consider the particular hypothesis space $\mathcal{H}$ depicted in Fig. 3.9. This hypothesis space contains a finite number of different hypothesis maps. Each individual hypothesis map corresponds to a particular decision tree.
For the small hypothesis space $\mathcal{H}$ in Fig. 3.9, empirical risk minimization is easy. Indeed, we just have to evaluate the empirical risk (“training error”) $\widehat{L}(h)$ for each hypothesis in $\mathcal{H}$ and pick the one yielding the smallest empirical risk. However, when allowing for a very large (deep) decision tree, the computational complexity of exactly solving the empirical risk minimization becomes intractable [17]. A popular approach to learn a decision tree is to use greedy algorithms which try to expand (grow) a given decision tree by adding new branches to leaf nodes in order to reduce the average loss on the training set (see [18, Chap. 8] for more details).

The idea behind many decision tree learning methods is quite simple: try out expanding a decision tree by replacing a leaf node with a decision node (implementing another “test” on the feature vector) in order to reduce the overall empirical risk much as possible.

## 计算机代写|机器学习代写MACHINE LEARNING代考|ERM FOR LINEAR REGRESSION

$$\widehat{\mathbf{w}}=\underset{\mathbf{w} \in \mathbb{R}^n}{\operatorname{argmin}} f(\mathbf{w}) \quad \text { with } f(\mathbf{w}):=(1 / m) \sum_{(\mathbf{x}, y) \in \mathcal{D}}\left(y-\mathbf{x}^T \mathbf{w}\right)^2 .$$

$$\mathbf{y}=\left(y^{(1)}, \ldots, y^{(m)}\right)^T \in \mathbb{R}^m \text {, and } \quad \mathbf{x}=\left(\mathbf{x}^{(1)}, \ldots, \mathbf{x}^{(m)}\right)^T \in \mathbb{R}^{m \times n}$$

$$f(\mathbf{w})=(1 / m)|\mathbf{y}-\mathbf{X w}|2^2$$

## 计算机代写|机器学习代写MACHINE LEARNING代考|ERM FOR DECISION TREES

17
.学习决策权的一种流行方法是使用尝试扩展的含心算法 grow通过向叶节点添加新分支来椷少训练集的平均损失的给定决策树 see [18, Chap. 8$]$ formoredetails.

## Matlab代写

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