模糊集运算规则合集之三,q-rung Orthopair fuzzy set 。 广义直觉模糊集合上的的运算规则,包括加法,乘法,数乘,幂乘,距离,得分函数精确函数,暂时我就用到这么多,之后有新研究会随时补充。
def scorenew1(df):
score=[]
for i in range(len(df)):
score.append(0.5*(1-df[i][0])*(1+(1-df[i][0]-df[i][1])))
return score
def scorenew2(df,q=2):
score=[]
for i in range(len(df)):
score.append(0.5*(1+(df[i][0]**q)-(df[i][1]**q)))
return score
def scorenew4(df,q=2):
score=[]
for i in range(len(df)):
score.append(((df[i][0]**q)-(df[i][1]**q)))
return score
def ltimes(lamda, coords2,q=2):
d1 = []
d2 = []
d = []
for x, y in coords2:
d1.append((1 - (1 - x**q) ** lamda)**(1/q))
d2.append(y ** lamda)
t = list(zip(*[d1, d2]))
for i in t:
d.append(list(i))
return d
def plus(coords1, coords2,q=2):
d1=[]
d2=[]
d=[]
for (x, y) in zip(coords1, coords2):
d1.append(((x[0]**q)+(y[0]**q)-(x[0]**q)*(y[0]**q))**(1/q))
d2.append(x[1]*y[1])
t=list(zip(*[d1,d2]))
for i in t:
d.append(list(i))
return d
def times(coords1, coords2,q=2):
d1=[]
d2=[]
d=[]
for (x, y) in zip(coords1, coords2):
d1.append(x[0]*y[0])
d2.append(((x[1]**q)+(y[1]**q)-(x[1]**q)*(y[1]**q))**(1/q))
t=list(zip(*[d1,d2]))
for i in t:
d.append(list(i))
return d
'''一些小例子'''
l1=[[0.6,0.5],[0.8,0.6]]
l2=[[0.6,0.2],[0.9,0.3]]
print(ltimes(1,l1))
print(times(l1,l2))
print(plus(l1,l2))
print(distance(l1[0],l2[1]))
|