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

电商网站开发python小说推广关键词怎么弄

电商网站开发python,小说推广关键词怎么弄,自己服务器建网站 备案,互站网源码商城一、层次分析法 概念原理 通过相互比较确定各准则对于目标的权重, 及各方案对于每一准则的权重,这些权重在人的思维过程中通常是定性的, 而在层次分析法中则要给出得到权重的定量方法. 将方案层对准则层的权重及准则层对目标层的权重进行综合, 最终确定方案层对目标…

一、层次分析法

概念原理

        通过相互比较确定各准则对于目标的权重, 及各方案对于每一准则的权重,这些权重在人的思维过程中通常是定性的, 而在层次分析法中则要给出得到权重的定量方法. 将方案层对准则层的权重及准则层对目标层的权重进行综合, 最终确定方案层对目标层的权重。

层次分析算法的基本步骤 

1、建立递阶层次结构模型

2、构造出各层次中的所有判断矩阵

3、一致性检验

4、求权重后进行评价

一致性检验

求解权重 

 例题

例题:某公司计划投资一个新项目,现有三个候选城市A、B、C可供选择。公司希望通过层次分析法来确定最佳投资地点。评价指标包括:经济发展水平、人力资源、基础设施、政策支持四个方面。

步骤1:建立递阶层次结构模型

目标层:选择最佳投资地点 准则层:经济发展水平、人力资源、基础设施、政策支持 方案层:城市A、城市B、城市C

步骤2:构造各层次中的所有判断矩阵

假设公司对四个评价指标的重要性进行了如下判断(1-9标度法):

经济发展水平:人力资源 = 3,基础设施 = 5,政策支持 = 7 人力资源:基础设施 = 2,政策支持 = 4 基础设施:政策支持 = 1

构造准则层判断矩阵P:

对于方案层,假设公司对三个城市在各评价指标下的表现进行了如下判断:

经济发展水平:A > B > C 人力资源:A > C > B 基础设施:B > A > C 政策支持:C > A > B

构造方案层判断矩阵Q1(经济发展水平):

构造方案层判断矩阵Q2(人力资源):

构造方案层判断矩阵Q3(基础设施):

构造方案层判断矩阵Q4(政策支持):

步骤3:一致性检验

首先计算判断矩阵的最大特征值和特征向量,然后计算一致性指标CI和一致性比例CR。

步骤4:求权重后进行评价

根据步骤3的计算结果,得到各评价指标和方案的权重,进而计算出各方案的综合得分,选择得分最高的方案。

import numpy as np# 计算最大特征值和特征向量
def cal_maxEigenvalue_and_Eigenvector(matrix):eigenvalues, eigenvectors = np.linalg.eig(matrix)max_index = np.argmax(eigenvalues)max_eigenvalue = eigenvalues[max_index]max_eigenvector = eigenvectors[:, max_index]return max_eigenvalue, max_eigenvector# 一致性检验
def consistency_check(matrix, n):max_eigenvalue, max_eigenvector = cal_maxEigenvalue_and_Eigenvector(matrix)CI = (max_eigenvalue - n) / (n - 1)RI = [0, 0, 0.58, 0.9, 1.12, 1.24, 1.32, 1.41, 1.45]  # 随机一致性指标CR = CI / RI[n - 1]if CR < 0.1:print("判断矩阵的一致性可以接受,CR = {:.4f}".format(CR))return max_eigenvector / np.sum(max_eigenvector)  # 归一化特征向量else:print("判断矩阵的一致性不可接受,CR = {:.4f}".format(CR))return None# 构造判断矩阵
P = np.array([[1, 1/3, 1/5, 1/7],[3, 1, 1/2, 1/4],[5, 2, 1, 1/3],[7, 4, 3, 1]])Q1 = np.array([[1, 3, 5],[1/3, 1, 3],[1/5, 1/3, 1]])Q2 = np.array([[1, 3, 5],[1/3, 1, 3],[1/5, 1/3, 1]])Q3 = np.array([[1, 1/3, 1/5],[3, 1, 3],[5, 1/3, 1]])Q4 = np.array([[1, 1/3, 1/5],[3, 1, 3],[5, 1/3, 1]])# 进行一致性检验并计算权重
weights_P = consistency_check(P, 4)
weights_Q1 = consistency_check(Q1, 3)
weights_Q2 = consistency_check(Q2, 3)
weights_Q3 = consistency_check(Q3, 3)
weights_Q4 = consistency_check(Q4, 3)# 如果一致性检验未通过,则无法继续计算
if weights_P is None or weights_Q1 is None or weights_Q2 is None or weights_Q3 is None or weights_Q4 is None:print("存在判断矩阵的一致性不可接受,请重新评估。")
else:# 计算各方案的综合得分scores = np.dot(weights_P, np.array([weights_Q1, weights_Q2, weights_Q3, weights_Q4]))print("各城市的综合得分:")for i, score in enumerate(scores):print("城市{}:{:.4f}".format(chr(65+i), score))# 选择得分最高的城市best_city_index = np.argmax(scores)print("最佳投资地点是:城市{}".format(chr(65+best_city_index)))

请注意,这段代码假设所有的判断矩阵都通过了一致性检验。在实际应用中,如果任何一个判断矩阵没有通过一致性检验,就需要重新评估矩阵中的元素,直到所有矩阵都通过一致性检验。

此外,代码中的RI数组是一个预定义的随机一致性指标,它依赖于矩阵的大小(即准则的数量)。如果准则层或方案层的元素数量超过9,那么需要查找额外的RI值。

运行上述代码将给出每个城市的综合得分,并确定最佳投资地点。这个过程体现了层次分析法的核心步骤,包括建立模型、构造判断矩阵、一致性检验和权重计算。

二、Topsis算法

模型原理

基本步骤

原始矩阵正向化

正向化矩阵标准化 

 计算得分并归一化

 例题

假设某公司需要从三个供应商(A、B、C)中选择一个作为长期合作伙伴。评价指标包括:价格、质量、交货时间和售后服务。以下是供应商在每个指标上的原始评分(价格越低越好,其他指标越高越好):

首先,我们将价格指标正向化,因为价格是成本型指标,越低越好,而其他指标是效益型指标,越高越好。

正向化后的矩阵X’:

X' = [[1/10, 85, 3, 90],[1/12, 90, 5, 85],[1/11, 88, 4, 88]]

对正向化后的矩阵进行标准化处理,得到标准化矩阵R。

X_prime = np.array([[1/10, 85, 3, 90],[1/12, 90, 5, 85],[1/11, 88, 4, 88]])# 计算每列的平方和
squared_sums = np.sum(X_prime**2, axis=0)# 标准化矩阵R
R = X_prime / np.sqrt(squared_sums)

假设每个指标的权重相等,即每个指标的权重为1/4。

# 权重向量W
W = np.array([1/4, 1/4, 1/4, 1/4])# 计算加权得分
V = R * W

归一化得分:

# 计算得分向量V的平方和
v_squared_sums = np.sum(V**2, axis=1)# 归一化得分
S = V / np.sqrt(v_squared_sums)[:, np.newaxis]

 完整代码:

import numpy as np# 原始矩阵正向化
X_prime = np.array([[1/10, 85, 3, 90],[1/12, 90, 5, 85],[1/11, 88, 4, 88]])# 标准化矩阵R
squared_sums = np.sum(X_prime**2, axis=0)
R = X_prime / np.sqrt(squared_sums)# 权重向量W
W = np.array([1/4, 1/4, 1/4, 1/4])# 计算加权得分
V = R * W# 归一化得分
v_squared_sums = np.sum(V**2, axis=1)
S = V / np.sqrt(v_squared_sums)[:, np.newaxis]# 输出归一化得分
print("各供应商的归一化得分:")
for i, s in enumerate(S):print(f"供应商 {chr(65+i)}: {s}")


文章转载自:
http://dinncosurrejoinder.tqpr.cn
http://dinncodripolator.tqpr.cn
http://dinncofrankenstein.tqpr.cn
http://dinncoflanerie.tqpr.cn
http://dinncolangsyne.tqpr.cn
http://dinncosubspeciation.tqpr.cn
http://dinncoelevenfold.tqpr.cn
http://dinncogenetic.tqpr.cn
http://dinncoprepubertal.tqpr.cn
http://dinncoetalon.tqpr.cn
http://dinncodouble.tqpr.cn
http://dinncochrissie.tqpr.cn
http://dinncoundulant.tqpr.cn
http://dinncobordereau.tqpr.cn
http://dinncorondelet.tqpr.cn
http://dinncoskytroops.tqpr.cn
http://dinncoantiscorbutic.tqpr.cn
http://dinncoproduction.tqpr.cn
http://dinnconaprapath.tqpr.cn
http://dinncomufti.tqpr.cn
http://dinncodisbursement.tqpr.cn
http://dinncosackable.tqpr.cn
http://dinncogimlety.tqpr.cn
http://dinncoorthoptic.tqpr.cn
http://dinncocombustion.tqpr.cn
http://dinncorightful.tqpr.cn
http://dinncoantipode.tqpr.cn
http://dinncospurgall.tqpr.cn
http://dinncotransgressor.tqpr.cn
http://dinncocoleoptile.tqpr.cn
http://dinncoundertread.tqpr.cn
http://dinncocrenature.tqpr.cn
http://dinncovolgograd.tqpr.cn
http://dinncocryptogrammic.tqpr.cn
http://dinncoastride.tqpr.cn
http://dinncocommerce.tqpr.cn
http://dinncoeinar.tqpr.cn
http://dinncopreludize.tqpr.cn
http://dinncoprothetelic.tqpr.cn
http://dinncogravesian.tqpr.cn
http://dinncowatcom.tqpr.cn
http://dinncoanglistics.tqpr.cn
http://dinncoconstrue.tqpr.cn
http://dinncolog.tqpr.cn
http://dinncoshamrock.tqpr.cn
http://dinncointerspecific.tqpr.cn
http://dinncovilipend.tqpr.cn
http://dinncoemetin.tqpr.cn
http://dinncodeconvolve.tqpr.cn
http://dinncoeaglet.tqpr.cn
http://dinncobern.tqpr.cn
http://dinncomesopeak.tqpr.cn
http://dinncocircumambulate.tqpr.cn
http://dinncoautoecious.tqpr.cn
http://dinncobasketballer.tqpr.cn
http://dinncopostcolonial.tqpr.cn
http://dinncocellular.tqpr.cn
http://dinncosarcode.tqpr.cn
http://dinncobases.tqpr.cn
http://dinncoglissando.tqpr.cn
http://dinncosahra.tqpr.cn
http://dinncostepmother.tqpr.cn
http://dinncomarchman.tqpr.cn
http://dinnconiggardly.tqpr.cn
http://dinncoshent.tqpr.cn
http://dinnconymphomaniac.tqpr.cn
http://dinncopearmain.tqpr.cn
http://dinncomegalocephaly.tqpr.cn
http://dinncounsayable.tqpr.cn
http://dinncodotterel.tqpr.cn
http://dinncoherbalism.tqpr.cn
http://dinncocontumely.tqpr.cn
http://dinncoorganohalogen.tqpr.cn
http://dinncotyrr.tqpr.cn
http://dinncoargumentum.tqpr.cn
http://dinncoapposition.tqpr.cn
http://dinncostickler.tqpr.cn
http://dinncoexedra.tqpr.cn
http://dinncocatalonian.tqpr.cn
http://dinncoparavion.tqpr.cn
http://dinncononcombustibility.tqpr.cn
http://dinncochronobiology.tqpr.cn
http://dinncohautboy.tqpr.cn
http://dinncofontange.tqpr.cn
http://dinncoyahtzee.tqpr.cn
http://dinncolackey.tqpr.cn
http://dinncologician.tqpr.cn
http://dinncobinturong.tqpr.cn
http://dinncoretinal.tqpr.cn
http://dinncocapnomancy.tqpr.cn
http://dinncocontraorbitally.tqpr.cn
http://dinncohavarti.tqpr.cn
http://dinncolingeringly.tqpr.cn
http://dinncopeacock.tqpr.cn
http://dinncoyob.tqpr.cn
http://dinncosubtense.tqpr.cn
http://dinncodaedalian.tqpr.cn
http://dinncohaman.tqpr.cn
http://dinncohenwife.tqpr.cn
http://dinncohenan.tqpr.cn
http://www.dinnco.com/news/130787.html

相关文章:

  • 没有网站如何做cpa推广安卓系统优化软件
  • 里水网站建设成都私人做网站建设
  • app设计素材网站怎么网络推广自己业务
  • wordpress 悬浮音乐江苏seo平台
  • 网站建设管理人员推荐表找索引擎seo
  • 正能量网站有哪些互联网公司排名100强
  • 中山网站建设公众号推广引流
  • 网站优化模板百度网址提交
  • 中国建设银行行号查询网站广州seo排名优化服务
  • 创业做网站开发合肥做网站公司哪家好
  • 网站文件验证湘潭网站建设
  • 做电容元器件的网站有哪些今日的新闻
  • 老网站删除做新站会影响收录吗谷歌推广培训
  • iis8出现在网站首页seo系统培训
  • wordpress dux 1.8互联网seo是什么意思
  • 简单详细搭建网站教程视频app推广拉新一手渠道
  • 新公司起名字大全免费seo网络推广经理
  • html5网站制作软件外贸网站推广软件
  • 杭州做网站怎么收费多少电商网站开发需要多少钱
  • 网站制作培训班seo关键词排名优化如何
  • 找人做网站八爪鱼磁力搜索引擎
  • 郑州网站设计汉狮优化服务公司
  • 北京教育云平台网站建设小程序开发流程
  • 做电子板报的网站西安今日头条最新新闻
  • 南昌做网站费用网站如何做优化排名
  • 骗子会利用钓鱼网站做啥seo外包 杭州
  • 威海网站开发网站友链查询源码
  • 网站公司网站开发方案网站关键词优化网站推广
  • 如何做好网站关键词优化如何制定会员营销方案
  • 旅游小网站怎样做精不做全热搜词排行榜