### 统计代写|机器学习作业代写machine learning代考| Bayesian Classifiers

statistics-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代考|The Single-Attribute Case

Let us start with something so simple as to be almost unrealistic: a domain where each example is described with a single attribute. Once we have grasped the principles of Bayesian classifiers under these simplified circumstances, we will generalize the idea for more realistic settings.
Prior probability and conditional probability. Let us return to the toy domain from the previous chapter. The training set consists of twelve pies ( $N_{a l l}=12$ ), of which six are positive examples of the given class $\left(N_{p a s}=6\right)$ and six are negative $\left(N_{\text {neg }}=6\right)$. Assuming that the examples represent faithfully the given domain, the probability of Johnny liking a randomly picked pie is fifty percent because fifty percent of the training examples are positive.
$$P(\mathrm{pos})=\frac{N_{p o s}}{N_{a l l}}=\frac{6}{12}=0.5$$

Let us now choose one of the attributes, say, filling-size. The training set contains eight examples with thick filling $\left(N_{\text {thick }}=8\right)$, of which three are labeled as positive $\left(N_{\text {pos } \mid \text { shick }}=3\right.$ ). We say that the conditional probability of an example being positive given that $f i l$ ing – si ze =thick is $37.5 \%$ : the relative frequency of positive examples among those with thick filling indicates:
$$P(\mathrm{pos} \mid \text { thick })=\frac{N_{\text {pos } \mid \text { hick }}}{N_{\text {thick }}}=\frac{3}{8}=0.375$$

## 统计代写|机器学习作业代写machine learning代考|Vectors of Discrete Attributes

Let us now proceed to a simple way of using the Bayes formula in more realistic domains where the examples are described by vectors of attributes such as $\mathbf{x}=$ $\left(x_{1}, x_{2}, \ldots, x_{n}\right)$, and where there are more than two classes.

Multiple Classes Many realistic applications are marked by more than two classes, not just the pos and neg from the “pies” domain. If $c_{l}$ is the label of the $i$-th class, and if $\mathbf{x}$ is the vector describing the object we want to classify, the Bayes formula acquires the following form:
$$P\left(c_{i} \mid \mathbf{x}\right)=\frac{P\left(\mathbf{x} \mid c_{i}\right) P\left(c_{i}\right)}{P(\mathbf{x})}$$
The denominator being the same for each class, we choose the class that maximizes the numerator, $P\left(\mathbf{x} \mid c_{i}\right) P\left(c_{i}\right)$. Here, $P\left(c_{i}\right)$ is estimated by the relative frequency of $c_{i}$ in the training set. With $P\left(\mathbf{x} \mid c_{i}\right)$, however, things are not so simple.

A Vector’s Probability $P\left(\mathbf{x} \mid c_{i}\right)$ is the probability that a randomly selected instance of class $c_{l}$ is described by vector $\mathbf{x}$. Can the value of this probability be estimated by relative frequency? Not really. In the “pies” domain, the size of the instance space was 108 different examples, of which the training set contained twelve, while none of the other vectors (the vast majority!) was represented at all. Relative frequency would indicate that the probability of $\mathbf{x}$ being positive is $P(\mathbf{x} \mid$ pos $)=1 / 6$ if we find $\mathbf{x}$ among the positive training examples, and $P(\mathbf{x} \mid \mathrm{pos})=0$ if we do not. In other words, any $\mathbf{x}$ identical to some training example “inherits” this example’s class label; if the vector is not in the training set, we have $P\left(\mathbf{x} \mid c_{i}\right)=0$ for any $c_{i}$. In this case, the numerator in the Bayes formula will always be $P\left(\mathbf{x} \mid c_{i}\right) P\left(c_{i}\right)=0$, which makes

it impossible for us to choose the most probable class. Evidently, we are not getting very far trying to calculate the probability of an event that occurs only once-if it occurs at all.

The situation improves if only individual attributes are considered. For instance, shape=circle occurs four times among the positive examples and twice among the negative, the corresponding probabilities thus being $P($ shape $=$ circle|pos $)=4 / 6$ and $P($ shape $=$ circle $\mid$ neg $)=2 / 6$. We see that, if an attribute can acquire only two or three values, chances are high that each of these values is represented in the training set more than once, thus providing better grounds for probability estimates.

## 统计代写|机器学习作业代写machine learning代考|Rare Events: An Expert’s Intuition

For simplicity, probability is often estimated by relative frequency. Having observed phenomenon $x$ thirty times in one hundred trials, we conclude that its probability is $P(x)=0.3$. This is how we did it in the previous sections.

Estimates of this kind, however, can be trusted only when based on a great many observations. While it is conceivable that a coin flipped four times comes up heads three times, it would be silly to jump to the conclusion that $P$ (heads) $=0.75$. The physical nature of the experiment suggests otherwise: a fair coin should come up heads fifty percent of the time. Can this prior expectation help us improve our probability estimates in domains with few observations?

The answer is yes. Prior expectations are employed in the so-called $m$-estimates.
Essence of $m$-Estimates Let us consider experiments with a coin that may be fairor unfair. In the absence of any extra information, our estimate of the probability of heads will be $\pi_{\text {heads }}=0.5$. But how confident are we in this estimate? This is quantified by an auxiliary parameter, $m$, that informs the class-predicting program about the amount of our uncertainty. The higher the value of $m$, the more the probability estimate, $\pi_{\text {head }}=0.5$, is to be trusted.

Returning to our experimental coin-flipping, let us denote by $N_{a l l}$ the total number of trials, and by $N_{\text {heads }}$ the number of “heads” observed in these trials. The following formula combines these values with the prior estimate and with our confidence in this estimate’s reliability:
$$P_{\text {heads }}=\frac{N_{\text {heads }}+m \pi_{\text {heads }}}{N_{a l l}+m}$$
Note that the formula degenerates to the prior estimate if no experimental evidence has yet been accumulated, in which case, $P_{\text {heads }}=\pi_{\text {heads }}$ because $N_{a l l}=N_{\text {heads }}=$ 0 . Conversely, the formula converges to that of relative frequency if $N_{a l l}$ and $N_{\text {heads }}$ are so big as to render negligible the terms $m \pi_{h e a d s}$ and $m$.
With $\pi_{\text {heads }}=0.5$ and $m=2$, we obtain the following:
$$P_{\text {heads }}=\frac{N_{\text {heads }}+2 \times 0.5}{N_{a l l}+2}=\frac{N_{\text {heads }}+1}{N_{a l l}+2}$$

## 广义线性模型代考

statistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于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 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。