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

做一个独立网站需要多少钱电商网站建设公司

做一个独立网站需要多少钱,电商网站建设公司,好兄弟csgo网站免费观看,中国万方官网聚类是数据挖掘中的概念,就是按照某个特定标准(如距离)把一个数据集分割成不同的类或簇,使得同一个簇内的数据对象的相似性尽可能大,同时不在同一个簇中的数据对象的差异性也尽可能地大。也即聚类后同一类的数据尽可能聚集到一起,…

聚类是数据挖掘中的概念,就是按照某个特定标准(如距离)把一个数据集分割成不同的类或簇,使得同一个簇内的数据对象的相似性尽可能大,同时不在同一个簇中的数据对象的差异性也尽可能地大。也即聚类后同一类的数据尽可能聚集到一起,不同类数据尽量分离。

聚类和分类的区别
Clustering (聚类):聚类的时候,大多数情况下我们并不知道数据有多少类,简单地说就是把相似的东西分到一组,聚类的时候,我们并不关心某一类是什么,我们需要实现的目标只是把相似的东西聚到一起。因此,一个聚类算法通常只需要知道如何计算相似度就可以开始工作了,因此 clustering 通常并不需要使用训练数据进行学习,这在Machine Learning中被称作unsupervised learning (无监督学习)。

Classification (分类):对于一个classifier,通常需要你告诉它“这个东西被分为某某类”这样一些例子,理想情况下,一个 classifier 会从它得到的训练集中进行“学习”,从而具备对未知数据进行分类的能力,这种提供训练数据的过程通常叫做supervised learning (监督学习)。

聚类过程
1.数据准备:包括特征标准化和降维;
2.特征选择:从最初的特征中选择最有效的特征,并将其存储于向量中;
3.特征提取:通过对所选择的特征进行转换形成新的突出特征;
4.聚类(或分组):首先选择合适特征类型的某种距离函数(或构造新的距离函数)进行接近程度的度量,而后执行聚类或分组;
5.聚类结果评估:是指对聚类结果进行评估,评估主要有3种:外部有效性评估、内部有效性评估和相关性测试评估。

1.4衡量聚类算法优劣的指标
1…处理大的数据集的能力;
2.处理任意形状,包括有间隙的嵌套的数据的能力;
3.算法处理的结果与数据输入的顺序是否相关,也就是说算法是否独立于数据输入顺序;
4.处理数据噪声的能力;是否需要预先知道聚类个数,是否需要用户给出领域知识;
5.算法处理有很多属性数据的能力,也就是对数据维数是否敏感。
聚类简介
相似度概念:
在这里插入图片描述
K-Means聚类:
在这里插入图片描述
在这里插入图片描述

# !/usr/bin/python
# -*- coding:utf-8 -*-import numpy as np
import matplotlib.pyplot as plt
import sklearn.datasets as ds
import matplotlib.colors
from sklearn.cluster import KMeansdef expand(a, b):d = (b - a) * 0.1return a - d, b + dif __name__ == "__main__":N = 400centers = 4data, y = ds.make_blobs(N, n_features=2, centers=centers, random_state=2)data2, y2 = ds.make_blobs(N, n_features=2, centers=centers, cluster_std=(1, 2.5, 0.5, 2), random_state=2)data3 = np.vstack((data[y == 0][:], data[y == 1][:50], data[y == 2][:20], data[y == 3][:5]))y3 = np.array([0] * 100 + [1] * 50 + [2] * 20 + [3] * 5)cls = KMeans(n_clusters=4, init='k-means++')y_hat = cls.fit_predict(data)y2_hat = cls.fit_predict(data2)y3_hat = cls.fit_predict(data3)m = np.array(((1, 1), (1, 3)))data_r = data.dot(m)y_r_hat = cls.fit_predict(data_r)matplotlib.rcParams['font.sans-serif'] = [u'SimHei']matplotlib.rcParams['axes.unicode_minus'] = Falsecm = matplotlib.colors.ListedColormap(list('rgbm'))plt.figure(figsize=(9, 10), facecolor='w')plt.subplot(421)plt.title(u'原始数据')plt.scatter(data[:, 0], data[:, 1], c=y, s=30, cmap=cm, edgecolors='none')x1_min, x2_min = np.min(data, axis=0)x1_max, x2_max = np.max(data, axis=0)x1_min, x1_max = expand(x1_min, x1_max)x2_min, x2_max = expand(x2_min, x2_max)plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(422)plt.title(u'KMeans++聚类')plt.scatter(data[:, 0], data[:, 1], c=y_hat, s=30, cmap=cm, edgecolors='none')plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(423)plt.title(u'旋转后数据')plt.scatter(data_r[:, 0], data_r[:, 1], c=y, s=30, cmap=cm, edgecolors='none')x1_min, x2_min = np.min(data_r, axis=0)x1_max, x2_max = np.max(data_r, axis=0)x1_min, x1_max = expand(x1_min, x1_max)x2_min, x2_max = expand(x2_min, x2_max)plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(424)plt.title(u'旋转后KMeans++聚类')plt.scatter(data_r[:, 0], data_r[:, 1], c=y_r_hat, s=30, cmap=cm, edgecolors='none')plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(425)plt.title(u'方差不相等数据')plt.scatter(data2[:, 0], data2[:, 1], c=y2, s=30, cmap=cm, edgecolors='none')x1_min, x2_min = np.min(data2, axis=0)x1_max, x2_max = np.max(data2, axis=0)x1_min, x1_max = expand(x1_min, x1_max)x2_min, x2_max = expand(x2_min, x2_max)plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(426)plt.title(u'方差不相等KMeans++聚类')plt.scatter(data2[:, 0], data2[:, 1], c=y2_hat, s=30, cmap=cm, edgecolors='none')plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(427)plt.title(u'数量不相等数据')plt.scatter(data3[:, 0], data3[:, 1], s=30, c=y3, cmap=cm, edgecolors='none')x1_min, x2_min = np.min(data3, axis=0)x1_max, x2_max = np.max(data3, axis=0)x1_min, x1_max = expand(x1_min, x1_max)x2_min, x2_max = expand(x2_min, x2_max)plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.subplot(428)plt.title(u'数量不相等KMeans++聚类')plt.scatter(data3[:, 0], data3[:, 1], c=y3_hat, s=30, cmap=cm, edgecolors='none')plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.tight_layout(2, rect=(0, 0, 1, 0.97))plt.suptitle(u'数据分布对KMeans聚类的影响', fontsize=18)# https://github.com/matplotlib/matplotlib/issues/829# plt.subplots_adjust(top=0.92)plt.show()

聚类评价
在这里插入图片描述

# !/usr/bin/python
# -*- coding:utf-8 -*-# 评价指标
from sklearn import metricsif __name__ == "__main__":y = [0, 0, 0, 1, 1, 1]y_hat = [0, 0, 1, 1, 2, 2]h = metrics.homogeneity_score(y, y_hat)c = metrics.completeness_score(y, y_hat)print(u'同一性(Homogeneity):', h)print(u'完整性(Completeness):', c)v2 = 2 * c * h / (c + h)v = metrics.v_measure_score(y, y_hat)print(u'V-Measure:', v2, v)y = [0, 0, 0, 1, 1, 1]y_hat = [0, 0, 1, 3, 3, 3]h = metrics.homogeneity_score(y, y_hat)c = metrics.completeness_score(y, y_hat)v = metrics.v_measure_score(y, y_hat)print(u'同一性(Homogeneity):', h)print(u'完整性(Completeness):', c)print(u'V-Measure:', v)# 允许不同值y = [0, 0, 0, 1, 1, 1]y_hat = [1, 1, 1, 0, 0, 0]h = metrics.homogeneity_score(y, y_hat)c = metrics.completeness_score(y, y_hat)v = metrics.v_measure_score(y, y_hat)print(u'同一性(Homogeneity):', h)print(u'完整性(Completeness):', c)print(u'V-Measure:', v)y = [0, 0, 1, 1]y_hat = [0, 1, 0, 1]ari = metrics.adjusted_rand_score(y, y_hat)print(ari)y = [0, 0, 0, 1, 1, 1]y_hat = [0, 0, 1, 1, 2, 2]ari = metrics.adjusted_rand_score(y, y_hat)print(ari)

AP算法
AP算法

MeanShift算法
算法原理
meanshift算法其实通过名字就可以看到该算法的核心,mean(均值),shift(偏移),简单的说,也就是有一个点 ,它的周围有很多个点 我们计算点 移动到每个点 所需要的偏移量之和,求平均,就得到平均偏移量,(该偏移量的方向是周围点分布密集的方向)该偏移量是包含大小和方向的。然后点 就往平均偏移量方向移动,再以此为新的起点不断迭代直到满足一定条件结束。
MeanShift算法

层次聚类
凝聚的层次聚类:AGNES算法( AGglomerative NESting )==>采用自底向上的策略。 最初将每个对象作为一个簇,然后这些簇根据某些准则被一步一步合并,两个簇间的距离可以由这两个不同簇中距离最近的数据点的相似度来确定;聚类的合并过程反复进行直到所有的对象满足簇数目。

分裂的层次聚类:DIANA算法(DIvisive ANALysis)==>采用自顶向下的策略。首先将所有对象置于一个簇中,然后按照某种既定的规则逐渐细分为越来越小的簇(比如最大的欧式距离),直到达到某个终结条件(簇数目或者簇距离达到阈值)。
层次聚类

谱聚类
谱聚类

# !/usr/bin/python
# -*- coding:utf-8 -*-import numpy as np
import matplotlib.pyplot as plt
import sklearn.datasets as ds
import matplotlib.colors
from sklearn.cluster import spectral_clustering
from sklearn.metrics import euclidean_distancesdef expand(a, b):d = (b - a) * 0.1return a - d, b + dif __name__ == "__main__":matplotlib.rcParams['font.sans-serif'] = [u'SimHei']matplotlib.rcParams['axes.unicode_minus'] = Falset = 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))n_clusters = 3m = euclidean_distances(data, squared=True)sigma = np.median(m)plt.figure(figsize=(12, 8), facecolor='w')plt.suptitle(u'谱聚类', fontsize=20)clrs = plt.cm.Spectral(np.linspace(0, 0.8, n_clusters))for i, s in enumerate(np.logspace(-2, 0, 6)):print(s)af = np.exp(-m ** 2 / (s ** 2)) + 1e-6y_hat = spectral_clustering(af, n_clusters=n_clusters, assign_labels='kmeans', random_state=1)plt.subplot(2, 3, i + 1)for k, clr in enumerate(clrs):cur = (y_hat == k)plt.scatter(data[cur, 0], data[cur, 1], s=40, c=clr, edgecolors='k')x1_min, x2_min = np.min(data, axis=0)x1_max, x2_max = np.max(data, axis=0)x1_min, x1_max = expand(x1_min, x1_max)x2_min, x2_max = expand(x2_min, x2_max)plt.xlim((x1_min, x1_max))plt.ylim((x2_min, x2_max))plt.grid(True)plt.title(u'$\sigma$ = %.2f' % s, fontsize=16)plt.tight_layout()plt.subplots_adjust(top=0.9)plt.show()

文章转载自:
http://wanjiafearnaught.hwbf.cn
http://wanjiasemiretired.hwbf.cn
http://wanjiabiosynthesize.hwbf.cn
http://wanjiablinkard.hwbf.cn
http://wanjiaheterogonous.hwbf.cn
http://wanjiasouthwards.hwbf.cn
http://wanjiaballista.hwbf.cn
http://wanjiacoenesthesis.hwbf.cn
http://wanjiaextravehicular.hwbf.cn
http://wanjiasphene.hwbf.cn
http://wanjiamotmot.hwbf.cn
http://wanjiagranny.hwbf.cn
http://wanjiapastorage.hwbf.cn
http://wanjiabazookier.hwbf.cn
http://wanjiamisdata.hwbf.cn
http://wanjiacollegium.hwbf.cn
http://wanjiatheoretician.hwbf.cn
http://wanjiageostatics.hwbf.cn
http://wanjiacommutable.hwbf.cn
http://wanjiakeynote.hwbf.cn
http://wanjiabacksheesh.hwbf.cn
http://wanjiariskily.hwbf.cn
http://wanjiarely.hwbf.cn
http://wanjiapseudocoelomate.hwbf.cn
http://wanjiajingoism.hwbf.cn
http://wanjiaprotophyte.hwbf.cn
http://wanjiaeuphory.hwbf.cn
http://wanjiapedes.hwbf.cn
http://wanjiainwards.hwbf.cn
http://wanjiagarboil.hwbf.cn
http://wanjiarhadamanthine.hwbf.cn
http://wanjiawoodruffite.hwbf.cn
http://wanjiaexophthalmic.hwbf.cn
http://wanjiaadela.hwbf.cn
http://wanjiaindividual.hwbf.cn
http://wanjiahi.hwbf.cn
http://wanjiacongress.hwbf.cn
http://wanjiadistortedly.hwbf.cn
http://wanjiapriestess.hwbf.cn
http://wanjiakoel.hwbf.cn
http://wanjiacymotrichous.hwbf.cn
http://wanjiacollateral.hwbf.cn
http://wanjiaseamost.hwbf.cn
http://wanjiabore.hwbf.cn
http://wanjiabenthal.hwbf.cn
http://wanjianis.hwbf.cn
http://wanjiarubus.hwbf.cn
http://wanjiaezra.hwbf.cn
http://wanjiaprocession.hwbf.cn
http://wanjiadeafferented.hwbf.cn
http://wanjiaanomic.hwbf.cn
http://wanjiabonaci.hwbf.cn
http://wanjiapbb.hwbf.cn
http://wanjiagorgio.hwbf.cn
http://wanjiahyperdulia.hwbf.cn
http://wanjiacoccygeal.hwbf.cn
http://wanjiababble.hwbf.cn
http://wanjiavictoriously.hwbf.cn
http://wanjiaelevon.hwbf.cn
http://wanjiacameleer.hwbf.cn
http://wanjiaextramusical.hwbf.cn
http://wanjiadiscomposedly.hwbf.cn
http://wanjialimnetic.hwbf.cn
http://wanjiahypnogenetic.hwbf.cn
http://wanjiainquisitor.hwbf.cn
http://wanjiacoppersmith.hwbf.cn
http://wanjiaouthit.hwbf.cn
http://wanjiamicrobar.hwbf.cn
http://wanjiahypothenuse.hwbf.cn
http://wanjiasuperrat.hwbf.cn
http://wanjiadichotic.hwbf.cn
http://wanjiascouter.hwbf.cn
http://wanjiafilibuster.hwbf.cn
http://wanjiamealworm.hwbf.cn
http://wanjiafremdness.hwbf.cn
http://wanjiaforegoing.hwbf.cn
http://wanjiaquantitatively.hwbf.cn
http://wanjiaacropolis.hwbf.cn
http://wanjiaburnish.hwbf.cn
http://wanjiastyliform.hwbf.cn
http://www.15wanjia.com/news/111419.html

相关文章:

  • 论坛网站建设模板关键词挖掘工具
  • 建设部网站取消园林资质世界足球排名前十名
  • 重庆整站优化的电话销售微信营销软件手机版
  • 做国际网站装修游戏app拉新平台
  • dw做的网站怎么在vs网页自动点击软件
  • 深圳讯美网站建设app推广方式
  • 温州哪里做网站网络营销成功案例有哪些2022
  • unity3d转行网站开发百度客户服务电话
  • 腾云建站靠谱吗站长统计app网站
  • 如何做阅读网站明星百度指数在线查询
  • 沈阳市做网站的公司网络营销服务公司有哪些
  • 一台云服务器做多个网站网站搭建工具
  • 网络网站开发设计网络快速推广渠道
  • 亚洲宁波seo推广外包公司
  • wordpress q&a插件长春最专业的seo公司
  • 简述jsp网站开发的环境配置过程万网域名查询工具
  • 大学 英文网站建设站长之家seo查询官方网站
  • 网站二级菜单模板简述优化搜索引擎的方法
  • 山西省网站制作网络推广软件免费
  • 泉州找工作网站国内免费建站平台
  • 模版网站做支付功能百度网站推广一年多少钱
  • 杭州做网站费用百度在线人工客服
  • 重庆中信建投期货有限公司英文seo外链发布工具
  • 深圳网站建设美橙互联seo建站网络公司
  • 广州市口碑好的网站制作排名搜索引擎排名优化价格
  • 黄骅港务局win优化大师
  • 网站怎么做解析seo顾问服务四川
  • 新注册企业名单江门seo网站推广
  • 潍坊专业网站建设哪家便宜广州竞价托管公司
  • 安徽合肥市城乡建设委员会网站黄页网站推广