当前位置:网站首页>Clustering of machine learning - the formation of DBSCAN deductive organization
Clustering of machine learning - the formation of DBSCAN deductive organization
2022-08-06 19:01:00 【Fat Pig Daddy】
Event address: CSDN 21-day Learning Challenge
Introduction
There is a vassal called DBSCAN clustering, which is a member of the Density Clustering Alliance.Everyone here has a consensus that the organization is king. At the beginning, a person was an organization, and they didn’t know each other. Later, some people had some friends around them, and they found that they could get some different information from others.And this information sometimes brings a business opportunity, so they get to know friends of friends, and later, they call friends, friends of friends, friends of friends of friends...all together, each otherA merger creates an organization, and those who enter it cannot enter other organizations.As a result, many organizations have formed in this country, and there is no need for the number of organizations designated by the state. These organizations are formed spontaneously according to the relationship between distance and nearness.For members within the organization, when they have made enough friends, they can become core members.There are strong and weak organizations, but they will not annex each other, which can make the country have a very stable political situation.Of course, when the number of people in the organization is too small, it is equivalent to noise and has no right to speak.
This is the national conditions of this country, is it a little similar to our world!The above attempts to explain the principle of DBSCAN in a popular expression, the following is a rigorous and brief description, come on, on the concept!
The principle of DBSCAN
The basic concepts are as follows:


The algorithm flow is as follows:

There are many articles describing the principle of DBSCAN in detail. Here is just a brief summary and personal understanding. Readers who are not addicted can study it in depth.The case below!
Case: Clustering of Special Shape Area Data
The code is as follows:
import numpy as npimport matplotlib.pyplot as pltimport matplotlib.colorsfrom sklearn.cluster import DBSCANif __name__ == "__main__":# datat = np.arange(0, 2*np.pi, 0.1)data1 = np.vstack((np.cos(t), np.sin(t))).Tdata2 = np.vstack((2*np.cos(t), 2*np.sin(t))).Tdata3 = np.vstack((3*np.cos(t), 3*np.sin(t))).Tdata = np.vstack((data1, data2, data3))# Parameters: (field radius, the minimum number of neighbors of the core object in the field radius), here prepare multiple sets of parameters for comparisonparams = ((0.5, 3), (0.5, 5), (0.5, 10), (1., 3))# drawing preparationmatplotlib.rcParams['font.sans-serif'] = ['SimHei']matplotlib.rcParams['axes.unicode_minus'] = Falseplt.figure(figsize=(9, 7), facecolor='w')plt.suptitle('DBSCAN clustering application', fontsize=15)# loop through all parametersfor i in range(4):eps, min_samples = params[i]# Build the model and cluster the datamodel = DBSCAN(eps=eps, min_samples=min_samples)model.fit(data)y_hat = model.labels_# count the number of clustersy_unique = np.unique(y_hat)n_clusters = y_unique.sizeprint('The number of clusters is:', n_clusters)# draw clustering resultsplt.subplot(2, 2, i+1)plt.scatter(data[:, 0], data[:, 1], s=40, c=y_hat, cmap=plt.cm.Spectral, edgecolors="k")plt.grid(visible=True, ls=":", color="#808080")plt.title(r'$\epsilon$ = %.1f m = %d, number of clusters: %d' % (eps, min_samples, n_clusters), fontsize=12)plt.tight_layout()plt.subplots_adjust(top=0.9)# plt.show()plt.savefig('dbscan.png', dpi=800)The results are as follows:

The author's level is limited, please leave a message to correct me if there is any inadequacy
边栏推荐
- Open3D 机载点云电力线提取
- qt实现coturn穿透客户端,coturn服务器搭建
- Euro-NCAP-2023 Safety Assisted Collision Avoidance System Test Procedure Chinese Version
- Getting Started with PreScan Quickly to Proficient in Lecture 21: Driver Model Drivers in the Loop
- Introduction to Mail Services POP3, SMTP and IMAP
- 简单了解冯·诺依曼体系结构
- golang工厂模式极简示例
- 得不到你的心,就用“分布式锁”锁住你的人
- Architecture Camp Graduation Summary
- 63:第五章:开发admin管理服务:16:开发【删除友情链接,接口】;(核心是:理解MongoDB,删除数据的逻辑)
猜你喜欢

weditor安装出现“UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xad in position 825: illegal multiby”

深入浅出富文本编辑器

云计算-存算一体-EDA-技术杂谈

62:第五章:开发admin管理服务:15:开发【新增/修改友情链接,接口】的修改功能;(其实在60篇博客中,已经开发好了)(核心是:理解MongoDB,修改数据的逻辑)

【浏览器】1403- 你不知道的浏览器页面渲染机制

基于显扬科技3D机器视觉HY-M5的金属零件测量系统

Euro-NCAP-2023-Safe Driving Assistance Driver Condition Monitoring DMS and Speed Limit Assist Test Procedure-Chinese Version

一分钟看懂TCP粘包拆包

电脑一键重装系统发现内存占用率过高怎么办

Getting Started with PreScan Quickly to Proficient in Lecture 21: Driver Model Drivers in the Loop
随机推荐
逐帧播放1
"UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 825: illegal multiby" appears in weditor installation
今天面了个腾讯拿 38K 出来的,让我见识到了基础的天花板
架构实战营毕业总结
How from form to get default value
Linear regression and logistic regression (logistic regression and linear regression)
好消息|又一省22年二建成绩查询时间公布
CarSim Simulation Advanced Advanced (3) ---VS Command Line (3)
Scala----For循环---02
搭建ExtMail邮件服务器
go install 指定版本包
OpenCV - 图像保留纹理去噪 fastNlMeansDenoising
Getting Started with PreScan Quickly to Proficient in Lecture 21: Driver Model Drivers in the Loop
MySQL中索引的基本知识
关于VS创建dll项目并导出类的教程(亲测可用)
深入浅出富文本编辑器
洞中一梦,闽都千年,《寻梦闽都》隧洞沉浸式演出惊艳亮相!
用u盘装系统教程操作图解
codesys TCP服务器程序
Application of selenium webDriver