当前位置:网站首页>吴恩达《机器学习》课程总结(13)_聚类
吴恩达《机器学习》课程总结(13)_聚类
2022-06-27 21:36:00 【51CTO】
13.1无监督学习:简介
将没有标签的样本分成不同的集合(簇),这种算法叫做聚类。常用的领域有市场分割、社交网络分析、计算机集群管理、了解星系等。
13.2K-均值算法
(1)K-均值是最普及的聚类算法,是一种迭代算法,假设需要将数据聚类成n个组,这时候首先随机选择K个点,称为聚类中心。
将每个样本归属到最近的聚类中心,然后重新计算每个类的中心变成新的聚类中心,重复以上步骤,直到聚类中心不变。


伪代码如下:

13.3优化目标
k-均值的最小化问题,就是每个样本点到对应聚类中心的距离之和:

与其他算法不同的是,k-均值每一次迭代都会是代价函数变小。
13.4随机初始化
(1)K应该小于样本数m;
(2)从样本中随机选取K个实例作为初始聚类中心。
K-均值可能会出现局部最小的情况,如下所示:

解决方案:多次运行该算法,最后在比较K-均值代价函数最小的结果,这种方法适用于K取较小的时候(2-10),K太大没有明显效果。
13.5选择聚类数
绘制聚类数与代价函数的图,然后选取出现斜率突然变小的地方的值(“肘部法则”)。


作者:你的雷哥
本文版权归作者所有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。
边栏推荐
- 图的存储结构
- 零基础自学SQL课程 | CASE函数
- 夏日的晚会
- Grab those duplicate genes
- Are the registered accounts of the top ten securities companies safe and risky?
- [PCL self study: pclvisualizer] point cloud visualization tool pclvisualizer
- [AI application] detailed parameters of NVIDIA Tesla v100-pcie-32gb
- 【论文阅读|深读】SDNE:Structural Deep Network Embedding
- Sentinel
- Feign implements path escape through custom annotations
猜你喜欢

零基础自学SQL课程 | SQL中的日期函数大全
![[try to hack] kill evaluation](/img/93/e623e25dc4dec1f656227c7651577e.png)
[try to hack] kill evaluation

Webserver flow chart -- understand the calling relationship between webserver modules

表单form 和 表单元素(input、select、textarea等)

Zero foundation self-study SQL course | if function
![[PCL self study: Segmentation3] PCL based point cloud segmentation: region growth segmentation](/img/9e/f08ce0729c89b0205c0ac47c523ad7.png)
[PCL self study: Segmentation3] PCL based point cloud segmentation: region growth segmentation

Zero foundation self-study SQL course | case function

赛尔笔记|视频文本预训练简述

MySQL分表查询之Merge存储引擎实现

Eliminate gaps around El image images
随机推荐
第 2 章 集成 MP
【AI应用】NVIDIA Tesla V100S-PCIE-32GB的详情参数
Chapter 2 integrated mp
Zero foundation self-study SQL course | if function
Pytorch Foundation (1)
[黑苹果系列] M910x完美黑苹果系统安装教程 – 2 制作系统U盘-USB Creation
ValidateRequest=”false” 是做什么的「建议收藏」
证券注册账户安全吗,会有风险吗?
2022 PMP project management examination agile knowledge points (3)
[digital ic/fpga] detect the position of the last matching sequence
VMware virtual machine bridging connectivity
Structure de stockage des graphiques
[PCL self study: segmentation4] point cloud segmentation based on Min cut
[tinyriscv verilator] branch transplanted to Da Vinci development board of punctual atom
Teach you how to transplant tinyriscv to FPGA
MySQL read / write separation configuration
如何找到外文文献对应的中文文献?
Is it safe to open a stock account through the account opening QR code of CICC securities manager? Or is it safe to open an account in a securities company?
单细胞数据清洗的这5个步骤你会做吗?
Const keyword and its function (usage), detailed explanation of C language const