19th Ave New York, NY 95822, USA

计算机代写|机器学习代写Machine Learning代考|K-means Clustering

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

计算机代写|机器学习代写Machine Learning代考|$K$-means Clustering

We begin with a simple method called $K$-means. Given $N$ input data vectors $\left{\mathbf{y}i\right}{i=1}^N$, we wish to label each vector as belonging to one of $K$ clusters. This labeling will be done via a binary matrix $\mathrm{L}$, the elements of which are given by
$$L_{i, j}= \begin{cases}1 & \text { if data point } i \text { belongs to cluster } j \ 0 & \text { otherwise }\end{cases}$$
The clustering is mutually exclusive. Each data vector $i$ can only be assigned to only cluster: $\sum_{j=1}^K L_{i, j}=1$. Along the way, we will also be estimating a center $\mathbf{c}j$ for each cluster. The full objective function for $K$-means clustering is: $$E(\mathbf{c}, \mathbf{L})=\sum{i, j} L_{i, j}\left|\mathbf{y}_i-\mathbf{c}_j\right|^2$$
This objective function penalizes the distance between each data point and the center of the cluster to which it is assigned. Hence, to minimize this error, we want to bring the cluster centers close to the data it has been assigned, and we also want to assign the data to nearby centers.

This objective function cannot be optimized in closed-form, and so an iterative method is required. It includes discrete variables (the labels L), and so gradient-based methods aren’t directly applicable. Instead, we use a strategy called coordinate descent, in which we alternate between closed-form optimization of one set of variables holding the other variables fixed. That is, we first pick initial values, then we alternate between updating the labels for the current centers, and then updating the centers for the current labels.

计算机代写|机器学习代写Machine Learning代考|K-medoids Clustering

(The material in this section is not required for this course.)
$K$-medoids clustering is a variant of $K$-means with the additional constraint that the cluster centers must be drawn from the data. The following algorithm, called Farthest First Traversal, or Hochbaum-Shmoys, is simple and effective:
Randomly select a data point $\mathbf{y}i$ as the first cluster center: $\mathbf{c}_1 \leftarrow \mathbf{y}_i$ for $j=2$ to $K$ $\quad$ Find the data point furthest from all existing centers: $\quad i \leftarrow \arg \max _i \min {k<j}\left|\mathbf{y}_i-\mathbf{c}_k\right|^2$ $\quad \mathbf{c}_j \leftarrow \mathbf{y}_i$ end for Label all remaining data points according to their nearest centers (as in $k$-means)
This algorithm provides a quality guarantee: it gives a clustering that is no worse than twice the error of the optimal clustering.
$K$-medoids clustering can also be improved by coordinate descent. The labeling step is the same as in $K$-means. However, the cluster updates must be done by brute-force search for each candidate cluster center update.

The Mixtures-of-Gaussians (MoG) model is a generalization of $K$-means clustering. Whereas $K$ means clustering works for clusters that are more or less spherical, the MoG model can handle oblong clusters and overlapping clusters. The $K$-means algorithm does an excellent job when clusters are well separated, but not when the clusters overlap. MoG algorithms compute a “soft,” probabilistic clustering which allows the algorithm to better handle overlapping clusters. Finally, the MoG model is probabilistic, and so it can be used to learn probability distributions from data.
The MoG model consists of $K$ Gaussian distributions, each with their own means and covariances $\left{\left(\mu_j, \mathbf{K}j\right)\right}$. Each Gaussian also has an associated (prior) probability $a_j$, such that $\sum_j a_j=1$. That is, the probabilities $a_j$ will represent the fraction of the data that are assigned to (or generated by) the different Gaussian components. As a shorthand, we will write all the model parameters with a single variable, i.e., $\theta=\left{a{1: K}, \mu_{1: K}, \mathbf{K}_{1: K}\right}$. When used for clustering, the idea is that each Gaussian component in the mixture should correspond to a single cluster.

The complete probabilistic model comprises the prior probabilities of each Gaussian component, and Gaussian likelihood over the data (or feature) space for each component:
\begin{aligned} P(L=j \mid \theta) & =a_j \ p(\mathbf{y} \mid \theta, L=j) & =G\left(\mathbf{y} ; \mu_j, \mathbf{K}_j\right) \end{aligned}

计算机代写|机器学习代写MACHINE LEARNING代考|K均值聚类

$$L_{i, j}={1 \quad \text { if data point } i \text { belongs to cluster } j 0 \quad \text { otherwise }$$

$$E(\mathbf{c}, \mathbf{L})=\sum i, j L_{i, j}\left|\mathbf{y}_i-\mathbf{c}_j\right|^2$$

计算机代写|机器学习代写MACHINE LEARNING代考|K-MEDOIDS CLUSTERING

Thematerialinthissectionisnotrequired forthiscourse.
$K$-medoids 聚类是 $K$-意味着必须从数据中提取聚类中心的附加约束。以下称为最远优先遍历或 Hochbaum-Shmoys 的算法简单有效: 随机选择一个数据点 $\mathbf{y} i$ 作为第一个聚类中心: $\mathbf{c}_1 \leftarrow \mathbf{y}_i$ 为了 $j=2$ 到 $K$ 找到距离所有现有中心最远的数据点:
$i \leftarrow \arg \max _i \min k<j\left|\mathbf{y}_i-\mathbf{c}_k\right|^2 \quad \mathbf{c}_j \leftarrow \mathbf{y}_i$ end for 根据最近的中心标记所有剩余的数据点asin $\$ k \$-$ means 该算法提供了质量保证：它给出的聚类不差于最优聚类误差的两倍。
$K$-medoids聚类也可以通过坐标下降来改进。标记步骤与 $K$-方法。但是，集群更新必须通过暴力搜索每个候选集群中心更新来完成。

$$P(L=j \mid \theta)=a_j p(\mathbf{y} \mid \theta, L=j) \quad=G\left(\mathbf{y} ; \mu_j, \mathbf{K}_j\right)$$

Matlab代写

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