def FOM(self):
"""
建设用地分类型精度
:return:
"""
source = self.result[-1]['myID']
simul = self.result[-1]['final']
real = self.result[-1]['endID']
misses, hits, wrongHits, falseAlarms = 0, 0, 0, 0
for x, y, z in zip(source, simul, real):
if z != x:
# 实际上发生改变
if y == x:
misses += 1 # 预测没有发生改变
else:
hits += 1 # 捕捉到实际的变化
if (y != z):
wrongHits += 1 # 捕捉到变化,但是预测错误
else:
# 实际上没有发生改变
if y != x:
falseAlarms += 1
return (hits * 1.0) / ((misses + hits + wrongHits + falseAlarms) * 1.0)
网友评论