当前位置:网站首页>MeanShift聚类-01原理分析
MeanShift聚类-01原理分析
2022-07-25 15:01:00 【维格堂406小队】
Intro
工作中用到了meanshift,不追溯太复杂的原理以及各种算法变体,原始paper等等。只从概念上,对原理做简要的总结和介绍。主要逻辑,参考sklearn的源码。
和常用k-means一样,meanshift也是一个迭代算法。我们关注的无非以下几点:
- 迭代的逻辑,按照什么方式进行迭代
- 迭代终止的条件
- 怎么给样本打label
主要逻辑
sklearn的代码逻辑如下:
- 初始化:生成bandwidth和seeds。如果没有指定bandwidth和seeds,会根据样本生成
- 并行化完成所有seeds的迭代,每个seed相当于是一个单独的迭代过程
- 迭代终止条件:max_iter=300或者阈值小于1e-3 * bandwidth
- 首次迭代时,seed就是聚类中心点,获取中心点bandwidth范围内的所有样本点
- 重新计算中心点(即求均值),再执行上一步,直到满足迭代停止条件
- 聚类中心点合并
- 按照每个中心点覆盖样本数排序,依次计算各个中心点之间的距离
- 在bandwidth以内的两个中心点,保留覆盖样本数高的中心点
- 给样本打label
- 找到每个样本附近最近的中心点,则改样本就归属于该类
- cluster_all=False,则bandwidth之外的点命名为-1,否则还是最近的聚类中心
Ref
[1] https://scikit-learn.org/stable/modules/generated/sklearn.cluster.MeanShift.html
2021-03-29 于南京市江宁区九龙湖
边栏推荐
- Stored procedure bias of SQL to LINQ
- [C题目]力扣206. 反转链表
- 基于AMD EPYC服务器的EDA芯片设计解决方案
- SQL Server forcibly disconnects
- 39 simple version of millet sidebar exercise
- 27 选择器的分类
- 45padding不会撑开盒子的情况
- @Scheduled source code analysis
- System. Accessviolationexception: an attempt was made to read or write to protected memory. This usually indicates that other memory is corrupted
- Gonzalez Digital Image Processing Chapter 1 Introduction
猜你喜欢

Leetcode combination sum + pruning

Resource not found: rgbd_ Launch solution

"Ask every day" reentrantlock locks and unlocks

【JS高级】js之正则相关函数以及正则对象_02

37 element mode (inline element, block element, inline block element)

37 元素模式(行内元素,块元素,行内块元素)

Heyuan City launched fire safety themed milk tea to boost fire prevention and control in summer

Browser based split screen reading

easygui使用的语法总结

流程控制(上)
随机推荐
给VS2010自动设置模板,加头注释
IP地址分类,判断一个网段是子网超网
27 classification of selectors
oracle_ 12505 error resolution
"How to use" decorator mode
I2C device driver hierarchy
41 picture background synthesis - colorful navigation map
Add the jar package under lib directory to the project in idea
LeetCode_因式分解_简单_263.丑数
Deployment and simple use of PostgreSQL learning
06、类神经网络
Leetcode combination sum + pruning
Unable to start web server when Nacos starts
SSM Advanced Integration
Spark parameter adjustment and tuning
Is it safe for Guolian securities to buy shares and open an account?
Kibana operation es
System. Accessviolationexception: an attempt was made to read or write to protected memory. This usually indicates that other memory is corrupted
"How to use" observer mode
MySQL sort