assignmentutor™您的专属作业导师

assignmentutor-lab™ 为您的留学生涯保驾护航 在代写机器学习 machine learning方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写机器学习 machine learning代写方面经验极为丰富，各种代写机器学习 machine learning相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 计算机代写|机器学习代写machine learning代考|What to Do If Errors Are Not Normally Distributed

Our abovementioned arguments characterized the relationship between the MSE and the normal (Gaussian) distribution. In summary, the MSE is a reasonable choice so long as our model errors are expected to be centered around zero, and not to have large outliers.

But what can we do if these assumptions do not hold? First, we consider how to validate the assumptions in the first place. Recall that our basic assumption asserts that the residuals
$$r_i=y_i-f_\theta\left(x_i\right)$$
follow a normal distribution. To begin with, a simple plot may reveal whether the residuals follow the desired overall trend.

Figure $2.7$ (left) shows a histogram of residuals $r_i$ for a simple prediction task, in which we estimate review lengths as a function of user gender (covered later in sec. 2.3.2). Although the plot has a slight bell shape, it deviates from the normal distribution in several key ways, for instance:

• The residuals do not appear to be centered around zero. In fact, the average residual is zero, ${ }^8$ though the largest bins in the histogram are somewhat below zero.
• The are some large outliers (i.e., extremely long reviews whose length was underpredicted).
• There are no small outliers, and there is almost no ‘left tail,’ that is, the model never significantly overpredicts.

Although the histogram in Figure $2.7$ allows us to quickly assess whether the residuals follow a normal distribution, this can be visualized more precisely by comparing the theoretical quantiles of a normal distribution to the observed residuals, as in Figure $2.7$ (right). ${ }^9$ The plot essentially compares the (sorted) residuals to those we would expect if we were to sample the same number of values from a normal distribution: If our residuals followed a normal distribution, plotting these quantities against each other would result in a straight line.

## 计算机代写|机器学习代写machine learning代考|Feature Engineering

Along with the simple linear function relating features to labels as in Equation (2.3) come significant limitations in terms of what kinds of relationships can be modeled with linear regression techniques. When modeling asymptotic, periodic. or other nonlinear relationships between features and labels. it is not yet clear how this can be accomplished given the limitations of this type of model.

As we shall see, complex relationships can be handled within the framework of linear models, so long as we exercise care by appropriately transforming our features (and labels). In practice, the success or failure of our models will often depend on carefully processing our data to help the model uncover the most salient relationships. This process of feature engineering proves critical even when developing deep learning models based on images or text: in spite of the vague promise of learning complex nonlinear relationships automatically, extracting meaningful signals from data is often a matter of careful engineering, rather than selecting a more complex model.

The first model we fit in Equation (2.6) revealed a positive association between review length and ratings. However, fitting the data with a line (fig. 2.4) does not seem to fit the data very accurately. Fitting the data with a line seems limiting, given that the trend may be better captured by a polynomial or asymptotic function (since the rating cannot grow above five stars).

Naively, we might think that this is a fundamental limitation of linear models. Note however that the assumption of linearity in $\theta$ (eq. (2.3)) does not prevent us from fitting (e.g.) a polynomial function. The polynomial equation rating $=\theta_0+\theta_1 \times($ review length $)+\theta_2 \times(\text { review length })^2$
is linear in $\theta$, even though we have transformed the input features in $X$.
This idea can be applied straightforwardly to fit polynomial functions, as shown in Figure 2.8. ${ }^{10}$

# 机器学习代考

## 计算机代写|机器学习代写机器学习代考|如果错误不是正态分布的该怎么办

.

$$r_i=y_i-f_\theta\left(x_i\right)$$

• 残差似乎不以零为中心。事实上，平均残差是零，${ }^8$尽管直方图中最大的箱子略低于零。
• 有一些较大的异常值(即，长度被低估的非常长的评论)。
• 没有小的异常值，而且几乎没有“左尾”，也就是说，模型从来没有显著的过度预测

虽然图$2.7$中的直方图允许我们快速评估残差是否遵循正态分布，但通过将正态分布的理论分位数与观察到的残差进行比较，可以更精确地可视化，如图$2.7$(右)所示。${ }^9$这幅图本质上是将(排序的)残差与我们期望的残差进行比较，如果我们从正态分布中抽样相同数量的值:如果残差遵循正态分布，那么将这些量相互绘图将得到一条直线。
计算机代写|机器学习代写machine learning代考|Feature Engineering .

除了如式(2.3)所示的将特征与标签联系起来的简单线性函数之外，还存在着可以用线性回归技术建模的关系种类方面的显著限制。当建模渐近，周期。或特征和标签之间的其他非线性关系。考虑到这类模型的局限性，目前尚不清楚如何实现这一目标

正如我们将看到的，复杂的关系可以在线性模型的框架内处理，只要我们适当地转换我们的特征(和标签)。在实践中，我们的模型的成功或失败通常取决于仔细处理我们的数据，以帮助模型发现最显著的关系。即使在开发基于图像或文本的深度学习模型时，这一特征工程过程也被证明是至关重要的:尽管自动学习复杂非线性关系的前景模糊，但从数据中提取有意义的信号往往是一个谨慎的工程问题，而不是选择一个更复杂的模型

我们在(2.6)式中拟合的第一个模型揭示了评论长度和评分之间的正相关关系。然而，用直线拟合数据(图2.4)似乎并不能非常准确地拟合数据。考虑到多项式或渐近函数可能更好地捕捉到趋势(因为评级不能增长到5颗星以上)，用直线拟合数据似乎是有限的

我们可能天真地认为，这是线性模型的一个基本限制。但请注意，$\theta$ (eq.(2.3))中的线性假设并不妨碍我们拟合(例如)多项式函数。评分$=\theta_0+\theta_1 \times($回顾长度$)+\theta_2 \times(\text { review length })^2$
的多项式方程在$\theta$中是线性的，即使我们在$X$中转换了输入特征。
这个想法可以直接应用于拟合多项式函数，如图2.8所示。${ }^{10}$

## 有限元方法代写

assignmentutor™作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

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

assignmentutor™您的专属作业导师
assignmentutor™您的专属作业导师