资源简介
ds 证据理论 python 代码
代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Tue May 16 16:32:06 2017
@author: Administrator
“““
#%%
def crd(M):
mn = M.shape
DM = np.ones((mm))
for i in range(m):
for j in range(m):
vec1 = M[i:]
vec2 = M[j:]
DM[ij] = np.linalg.norm(vec1 - vec2)
# SM = ((np.sqrt(2) -DM)/np.sqrt(2))**2
sm = (DM)/np.sqrt(2)/2+0.5
e = 4*sm*(1-sm)
b = np.sum(eaxis=1)-1
c = sum(b)
crd = b/c
return crd
#%%
def muti_row(mk):
row_num = len(k)
pq = m.shape
l = np.ones((pq))
for i in range(row_num):
l[i:]=m[i:]*k[i]
return l
#%%
def discount(mprcrd):
m_trans = m.T
d1 = np.sum(m_trans*pr*crdaxis=1)
d2 = (d1-min(d1))/(max(d1)-min(d1))
d3 = d2/sum(d2)
return d3
#%%
pr1 = 1
pr2 = 1
pr3 = 1
pr4 = 1
pr5 = 1
#%%
#m1 = [100]
#m2 = [010]
#m3 = [0.80.10.1]
#m4 = [0.80.10.1]
#%%
#m1=[0.50.20.3]
#m2=[0.50.20.3]
#m3=[00.90.1]
#m4=[0.50.20.3]
#%%
#m1=[0.90.10]
#m2=[00.10.9]
#m3=[0.10.150.75]
#m4=[0.10.150.75]
#%%
m1= [0.70.10.1 0.0 0.1 ]
m2= [0.00.50.2 0.1 0.2 ]
m3= [0.60.10.150.0 0.15]
m4=[0.550.10.1 0.150.1 ]
m5= [0.60.10.2 0.0 0.1 ]
#%%
# 证据矩阵
m = np.array([m1m2m3m4m5])
# 优先级矩阵
pr = np.array([pr1pr2pr3pr4pr5])
# 可信度向量
crd = crd(m)
#
discount_evidence = discount(mprcrd)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 18 2014-10-17 03:39 python ds evidence theory\.gitignore
....... 333 2014-10-17 03:39 python ds evidence theory\.project
....... 407 2014-10-17 03:39 python ds evidence theory\.pydevproject
文件 1463 2017-05-19 09:33 python ds evidence theory\ds_competition.py
文件 5923 2017-05-19 09:20 python ds evidence theory\ds_test.py
文件 2646 2017-05-17 10:55 python ds evidence theory\ds_test2.py
....... 4189 2014-10-17 03:39 python ds evidence theory\examples.py
....... 1478 2014-10-17 03:39 python ds evidence theory\LICENSE
....... 52776 2014-10-17 03:39 python ds evidence theory\pyds.py
....... 26266 2014-10-17 03:39 python ds evidence theory\pyds_test.py
....... 446 2014-10-17 03:39 python ds evidence theory\README
....... 742 2014-10-17 03:39 python ds evidence theory\setup.py
....... 6487 2014-10-17 03:39 python ds evidence theory\stats.py
文件 60087 2017-05-16 20:35 python ds evidence theory\__pycache__\pyds.cpython-35.pyc
目录 0 2017-05-16 20:35 python ds evidence theory\__pycache__
目录 0 2017-05-19 09:21 python ds evidence theory
----------- --------- ---------- ----- ----
163261 16
- 上一篇:you-get妹子图.py
- 下一篇:批量excel转shp(面)python
评论
共有 条评论