-
本章节的评价模型:
- TOPSIS
- 熵值法
- 秩和比综合评价法
- 灰色关联分析
- 层次分析法(在习题中无法使用:不知道指标的含义无法比较)
-
9.1 某公司需要对其信息化建设方案进行评估,方案偶4家信息咨询公司分别提供,记为方案1(S1),
方案2(S2),方案3(S3),方案4(S4).每套方案的评估标准包括以下的6项内容:x1(目标指标),
x2(经济成本),x3(实施可能性),x4(技术可能性),x5(人力资源成本),x6(抗风险能力)。其中,
x2,x5时成本型指标,其他为效益型指标。这里每个方案所对应的属性值均由评估专家打分给出,表9.9列出了专家对各方案属性的评分结果,请对4个方案进行综合评价
方案 x1 x2 x3 x4 x5 x6 0 S1 8.1 255 12.6 13.2 76 5.4 1 S2 6.7 210 13.2 10.7 102 7.2 2 S3 6 233 15.3 9.5 63 3.1 3 S4 4.5 202 15.2 13 120 2.6 -
先将成本型指标转化为效益型指标
-
统一量纲
-
选择评价模型:
- 理想解法
# 将DataFrame 转化为二维矩阵 注意读取的数据类型要设置为浮点型 data = pd.read_excel(r'C:\Users\lenovo\Desktop\9.1.xlsx',usecols=[1,2,3,4,5,6],dtype='float').values # x2,x5转化为效益型指标(取倒数) data[:,1]= 1/data[:,1];data[:,4]=1/data[:,4] #统一量纲:向量化处理 for i in range(data.shape[1]): data[:,i]=data[:,i]/np.linalg.norm(data[:,i]) cplus=data.max(axis=0) #逐列求最大值 cminus=data.min(axis=0) #逐列求最小值 d1=np.linalg.norm(data-cplus, axis=1) #求到正理想解的距离 d2=np.linalg.norm(data-cminus, axis=1) #求到负理想解的距离 print(d1, d2) #显示到正理想解和负理想解的距离 f1=d2/(d1+d2); print("TOPSIS的评价值为:", f1) TOPSIS的评价值为: [0.64411549 0.62847897 0.42283182 0.25088623]
-
-
9.2 对一个企业的经济效益评价也是一个复杂的问题,能够反映企业经济效益的主要指标有4项:x1(总产值/消耗),x2(净产值),x3(盈利/资金占有),x4(销售收入/成本)。先设有二十家企业经济指标如表9.10所示,试运用两种以上的综合评价方法,对20家企业经济效益进行综合评价
企业 x1 x2 x3 x4 A1 1.611 10.59 0.69 1.67 A2 1.429 9.44 0.61 1.5 A3 1.447 5.97 0.24 1.25 A4 1.572 10.78 0.75 1.71 A5 1.483 10.99 0.75 1.44 A6 1.371 6.46 0.41 1.31 A7 1.665 10.51 0.53 1.52 A8 1.403 6.11 0.17 1.32 A9 2.62 21.51 1.4 2.59 A10 2.033 24.15 1.8 1.89 A11 2.015 26.86 1.93 2.02 A12 1.501 9.74 0.87 1.48 A13 1.578 14.52 1.12 1.47 A14 1.735 14.64 1.21 1.91 A15 1.453 12.88 0.87 1.52 A16 1.765 17.94 0.89 1.4 A17 1.532 29.42 2.52 1.8 A18 1.488 9.23 0.81 1.45 A19 2.586 16.07 0.82 1.83 A20 1.992 2.63 1.01 1.89 -
确定评价方法
- TOPSIS
- 熵值法
- 秩序和比
- 灰色关联分析
import pandas as pd
import numpy as np
from scipy.stats import rankdata
# 将DataFrame 转化为二维矩阵
a = pd.read_excel(r'C:\Users\lenovo\Desktop\9.10.xlsx',usecols=[1,2,3,4],dtype='float').values
cplus=a.max(axis=0) #逐列求最大值
cminus=a.min(axis=0) #逐列求最小值
print("正理想解=",cplus,"负理想解=",cminus)
d1=np.linalg.norm(a-cplus, axis=1) #求到正理想解的距离
d2=np.linalg.norm(a-cminus, axis=1) #求到负理想解的距离
print(d1, d2) #显示到正理想解和负理想解的距离
f1=d2/(d1+d2); print("TOPSIS的评价值为:", f1)
t=cplus-a #计算参考序列与每个序列的差
mmin=t.min(); mmax=t.max() #计算最小差和最大差
rho=0.5 #分辨系数
xs=(mmin+rho*mmax)/(t+rho*mmax) #计算灰色关联系数
f2=xs.mean(axis=1) #求每一行的均值
print("\n关联系数=", xs,'\n关联度=',f2) #显示灰色关联系数和灰色关联度
[n, m]=a.shape
cs=a.sum(axis=0) #逐列求和
P=1/cs*a #求特征比重矩阵
e=-(P*np.log(P)).sum(axis=0)/np.log(n) #计算熵值
g=1-e #计算差异系数
w = g / sum(g) #计算权重
F = P @ w #计算各对象的评价值
print("熵值法:\nP={}\n,e={}\n,g={}\n,w={}\nF={}".format(P,e,g,w,F))
R=[rankdata(a[:,i]) for i in np.arange(a.shape[1])] #求每一列的秩
R=np.array(R).T #构造秩矩阵
print("\n秩矩阵为:\n",R)
RSR=R.mean(axis=1)/n; print("RSR=", RSR)