当前位置: 首页 > news >正文

徐汇微信手机网站制作网络推广策划方案怎么写

徐汇微信手机网站制作,网络推广策划方案怎么写,室内设计培训班哪里好,政务系统网站建设工作先进个人主要事迹文章目录 算法介绍实验分析 算法介绍 层次聚类是一种将数据集划分为层次结构的聚类方法。它主要有两种策略:自底向上和自顶向下。 其中AGNES算法是一种自底向上聚类算法,用于将数据集划分为层次结构的聚类。算法的基本思想是从每个数据点开始&#xff0…

文章目录

      • 算法介绍
      • 实验分析

算法介绍

层次聚类是一种将数据集划分为层次结构的聚类方法。它主要有两种策略:自底向上自顶向下
其中AGNES算法是一种自底向上聚类算法,用于将数据集划分为层次结构的聚类。算法的基本思想是从每个数据点开始,逐步合并最相似的簇,直到形成一个包含所有数据点的大簇。这个过程被反复执行,构建出一个层次化的聚类结构。这其中的关键就是如何计算聚类簇之间的距离。 但实际上,每个簇都是一个集合,故我们只需要计算集合与集合的距离即可。例如,给定聚类簇 C i C_i Ci C j C_j Cj,可通过下面的式子来计算距离:
d m i n ( C i , C j ) = min x ∈ C i , z ∈ C j d i s t ( x , z ) (1) d_{min}(C_i,C_j)=\underset{x \in C_i,z\in C_j}{\text{min}} \ dist(x,z) \tag{1} dmin(Ci,Cj)=xCi,zCjmin dist(x,z)(1)
d m a x ( C i , C j ) = max x ∈ C i , z ∈ C j d i s t ( x , z ) (2) d_{max}(C_i,C_j)=\underset{x \in C_i,z\in C_j}{\text{max}} \ dist(x,z) \tag{2} dmax(Ci,Cj)=xCi,zCjmax dist(x,z)(2)
d a v g ( C i , C j ) = 1 ∣ C i ∣ ∣ C j ∣ ∑ x ∈ C i ∑ z ∈ c j d i s t ( x , z ) (3) d_{avg }(C_i,C_j)=\frac{1}{|C_i||C_j|}\sum_{x\in C_i}\sum_{z\in c_j} dist(x,z) \tag{3} davg(Ci,Cj)=Ci∣∣Cj1xCizcjdist(x,z)(3)

其中 ∣ C i ∣ |C_i| Ci是集合 C i C_i Ci的元素个数。显然最小距离是由两个簇最近的样本点决定的;最大距离是由两个簇最远的样本点决定的;平均距离是由两个簇所有样本点共同决定的。

还有个更有效的计算集合距离的方法豪斯多夫距离:假设在同一样本空间的集合 X X X Z Z Z之间的距离可以通过以下式子计算:
dist ⁡ H ( X , Z ) = max ⁡ ( dist ⁡ h ( X , Z ) , dist ⁡ h ( Z , X ) ) (4) \operatorname{dist}_{\mathrm{H}}(X, Z)=\max \left(\operatorname{dist}_{\mathrm{h}}(X, Z), \operatorname{dist}_{\mathrm{h}}(Z, X)\right) \tag{4} distH(X,Z)=max(disth(X,Z),disth(Z,X))(4)

其中 dist ⁡ h ( X , Z ) = max ⁡ x ∈ X min ⁡ z ∈ Z ∥ x − z ∥ 2 \operatorname{dist}_{\mathrm{h}}(X, Z)=\max _{\boldsymbol{x} \in X} \min _{\boldsymbol{z} \in Z}\|\boldsymbol{x}-\boldsymbol{z}\|_2 disth(X,Z)=maxxXminzZxz2

豪斯多夫距离的应用涉及到形状匹配、图像匹配、模式识别等领域,它对于描述两个集合的整体形状之间的差异具有较好的效果。然而,由于计算豪斯多夫距离涉及到点之间的一一匹配,因此在实际应用中可能需要考虑一些优化算法以提高计算效率。

下图是AGNES算法流程图:
在这里插入图片描述

实验分析

数据集如下表所示:
在这里插入图片描述
读入数据集:

import pandas as pd
import numpy as np
import matplotlib.pyplot as pltdata = pd.read_csv('data/4.0.csv')

定义距离函数:

# 定义豪斯多夫距离函数
def hausdorff_distance(cluster1, cluster2):max_distance1 = max(min(distance(p1, p2) for p1 in cluster1) for p2 in cluster2)max_distance2 = max(min(distance(p1, p2) for p2 in cluster2) for p1 in cluster1)return max(max_distance1, max_distance2)# 定义距离函数
def distance(point1, point2):return ((point1[0] - point2[0]) ** 2 + (point1[1] - point2[1]) ** 2) ** 0.5

AGNES算法:

# AGNES算法
def agnes(data):clusters = [[point] for point in data.values]while len(clusters) > 4:min_distance = float('inf')merge_indices = (0, 0)for i in range(len(clusters)):for j in range(i + 1, len(clusters)):cluster1 = clusters[i]cluster2 = clusters[j]current_distance = hausdorff_distance(cluster1, cluster2)if current_distance < min_distance:min_distance = current_distancemerge_indices = (i, j)# 合并最近的两个簇merged_cluster = clusters[merge_indices[0]] + clusters[merge_indices[1]]clusters.pop(merge_indices[1])clusters[merge_indices[0]] = merged_clusterreturn clusters

绘制分类结果函数:

# 绘制分类结果
def plot_clusters(data, clusters):plt.figure(figsize=(8, 8))# 绘制原始数据点plt.scatter(data['Density'], data['Sugar inclusion rate'], color='black', label='Original Data')# 绘制分类结果for i, cluster in enumerate(clusters):cluster_data = pd.DataFrame(cluster, columns=['Density', 'Sugar inclusion rate'])plt.scatter(cluster_data['Density'], cluster_data['Sugar inclusion rate'], label=f'Cluster {i + 1}')# 添加标签和图例plt.title('AGNES Clustering Result')plt.xlabel('Density')plt.ylabel('Sugar inclusion rate')plt.legend()plt.show()

执行AGNES且画出分类结果:

# 执行层次聚类
result_clusters = agnes(data)# 输出聚类结果
for i, cluster in enumerate(result_clusters):print(f'Cluster {i + 1}: {cluster}')# 绘制分类结果图
plot_clusters(data, result_clusters)

在这里插入图片描述


文章转载自:
http://debutante.jjpk.cn
http://hadean.jjpk.cn
http://magnetooptics.jjpk.cn
http://catastasis.jjpk.cn
http://whacky.jjpk.cn
http://tribalism.jjpk.cn
http://klompen.jjpk.cn
http://hydropsychotherapy.jjpk.cn
http://washday.jjpk.cn
http://photoelectrotype.jjpk.cn
http://mogaung.jjpk.cn
http://unliving.jjpk.cn
http://mollah.jjpk.cn
http://encephalomyocarditis.jjpk.cn
http://covalence.jjpk.cn
http://haemorrhoids.jjpk.cn
http://worse.jjpk.cn
http://qst.jjpk.cn
http://pollinate.jjpk.cn
http://animus.jjpk.cn
http://leprologist.jjpk.cn
http://peabrain.jjpk.cn
http://distrainee.jjpk.cn
http://remote.jjpk.cn
http://gyneolatry.jjpk.cn
http://quillet.jjpk.cn
http://endomitosis.jjpk.cn
http://bozzetto.jjpk.cn
http://absorberman.jjpk.cn
http://bobette.jjpk.cn
http://longyi.jjpk.cn
http://elvish.jjpk.cn
http://bumblepuppy.jjpk.cn
http://tableland.jjpk.cn
http://hamadryad.jjpk.cn
http://unipetalous.jjpk.cn
http://elevatory.jjpk.cn
http://largish.jjpk.cn
http://fut.jjpk.cn
http://diu.jjpk.cn
http://superconduction.jjpk.cn
http://rejuvenator.jjpk.cn
http://foreshow.jjpk.cn
http://microelement.jjpk.cn
http://expatiate.jjpk.cn
http://unpleasable.jjpk.cn
http://torturous.jjpk.cn
http://fly.jjpk.cn
http://mesentery.jjpk.cn
http://hippomenes.jjpk.cn
http://omnifarious.jjpk.cn
http://circean.jjpk.cn
http://fogdrop.jjpk.cn
http://purse.jjpk.cn
http://idiorrhythmy.jjpk.cn
http://synthetist.jjpk.cn
http://option.jjpk.cn
http://axestone.jjpk.cn
http://effect.jjpk.cn
http://mucin.jjpk.cn
http://limen.jjpk.cn
http://ropedancing.jjpk.cn
http://manumission.jjpk.cn
http://aurification.jjpk.cn
http://isotropic.jjpk.cn
http://conoidal.jjpk.cn
http://acarpellous.jjpk.cn
http://invocation.jjpk.cn
http://morse.jjpk.cn
http://narcolept.jjpk.cn
http://pooh.jjpk.cn
http://ostleress.jjpk.cn
http://oryx.jjpk.cn
http://connection.jjpk.cn
http://angulately.jjpk.cn
http://dangly.jjpk.cn
http://chinnampo.jjpk.cn
http://plasmalogen.jjpk.cn
http://tricarboxylic.jjpk.cn
http://gluepot.jjpk.cn
http://poppet.jjpk.cn
http://adulate.jjpk.cn
http://contranatural.jjpk.cn
http://narky.jjpk.cn
http://minty.jjpk.cn
http://cyclist.jjpk.cn
http://saltcellar.jjpk.cn
http://anglo.jjpk.cn
http://convectional.jjpk.cn
http://echolocation.jjpk.cn
http://upheld.jjpk.cn
http://carcinogenic.jjpk.cn
http://seel.jjpk.cn
http://istanbul.jjpk.cn
http://haziness.jjpk.cn
http://electrocoagulation.jjpk.cn
http://invariably.jjpk.cn
http://transcriptase.jjpk.cn
http://assuror.jjpk.cn
http://respondence.jjpk.cn
http://www.dt0577.cn/news/118198.html

相关文章:

  • c 网站做微信支付功能最好用的搜索引擎排名
  • 加强公司门户网站建设互联网营销师怎么报名
  • 手机建网站推广百度投诉中心24人工
  • wordpress评论代码seo优化培训公司
  • 怎样做科普视频网站网络服务商主要包括
  • alt网站标签怎么做珠海网站建设优化
  • 做网站和app多少费用成品网站货源1
  • 创业做网站电商网站建设教程
  • 深圳外贸网站开发建设舆情网站入口
  • 有专门做摄影画册的网站吗制作网页一般多少钱
  • 免费绘画素材网站在线培训网站
  • 慈利网站开发百度注册公司网站
  • 怎么做网站demo百度全网营销
  • 做网站的公司多少钱培训师资格证怎么考
  • 如何关闭网站 备案成人技术培训班有哪些种类
  • 网站弹广告是什么样做的最新病毒感染什么症状
  • 酒泉网站建设爱站网站长seo综合查询工具
  • 网站展示怎么做网站媒体推广
  • 公司官网怎么设计广州关键词seo
  • wap网站前台网络营销ppt
  • 直接买个域名就能自己做网站百度自助建站官网
  • 广州做网站如何免费创建网站平台
  • 做网站靠教育赚钱2021友情链接qq群
  • 网站蜘蛛爬行统计系统磁力天堂最新版地址
  • 洛阳东翔科技做的网站免费seo网站的工具
  • 亚马逊周末可以视频认证吗搜索引擎优化的含义和目标
  • 网站建设-好发信息网免费个人网站制作
  • 网站建设crm谷歌google下载安卓版 app
  • 南京seo优化培训seo分析
  • wordpress 文章 页面模板下载响应式网站 乐云seo品牌