数学建模常用模型(七) :模糊综合评价法

数学建模常用模型(七) :模糊综合评价法

模糊综合评价法(Fuzzy Comprehensive Evaluation Method)是一种基于模糊数学理论的评价方法,用于处理模糊、不确定或多指标的决策问题。该方法将模糊集合理论与数学模型相结合,通过量化和综合各种评价指标的模糊信息,得出最终的评价结果。
模糊综合评价法在许多领域中应用广泛,如决策分析、工程评价、经济评估、环境评价等。它能够处理多指标、不确定性和模糊性的问题,提供一种相对灵活和全面的评价方法。
这是我自己总结的一些代码和资料(本文中的代码以及参考书籍等),放在github上供大家参考:https://github.com/HuaandQi/Mathematical-modeling.git

1.模糊综合评价法的基本步骤:

(1)确定评价指标:确定用于评价问题的指标,并定义每个指标的评价等级或隶属函数。
(2)确定隶属函数:为每个指标的评价等级定义模糊隶属函数,将指标的取值映射到一个隶属度值,表示该指标在某个评价等级上的程度。
(3)构建评价矩阵:将各指标的评价等级转化为评价矩阵,矩阵中的元素表示各指标在各评价等级上的隶属度值。
(4)确定权重:根据问题的要求或专家的意见,确定各评价指标的权重,用于对不同指标的重要性进行量化。
(5)模糊综合评价:将评价矩阵与权重相乘,得到加权评价矩阵。对加权评价矩阵的每一列进行模糊综合运算(如最大值、最小值、平均值等),得出综合评价结果。
(6)解模糊化:对综合评价结果进行解模糊化处理,将模糊的评价结果转化为具体的数值。
(7)结果分析与决策:根据解模糊化后的评价结果进行分析和决策,确定最终的评价等级或做出相应的决策。

2.程序实例

以下是使用Python进行模糊综合评价的简单例子,我们将使用scikit-fuzzy库来实现模糊逻辑运算。

import numpy as np
import skfuzzy as fuzz

# 定义评价指标和评价等级
price = np.arange(0, 11, 1)
appearance = np.arange(0, 11, 1)
functionality = np.arange(0, 11, 1)
durability = np.arange(0, 11, 1)

# 定义模糊隶属函数
price_low = fuzz.trimf(price, [0, 0, 5])
price_medium = fuzz.trimf(price, [0, 5, 10])
price_high = fuzz.trimf(price, [5, 10, 10])

appearance_poor = fuzz.trimf(appearance, [0, 0, 5])
appearance_average = fuzz.trimf(appearance, [0, 5, 10])
appearance_good = fuzz.trimf(appearance, [5, 10, 10])

functionality_poor = fuzz.trimf(functionality, [0, 0, 5])
functionality_average = fuzz.trimf(functionality, [0, 5, 10])
functionality_good = fuzz.trimf(functionality, [5, 10, 10])

durability_poor = fuzz.trimf(durability, [0, 0, 5])
durability_average = fuzz.trimf(durability, [0, 5, 10])
durability_good = fuzz.trimf(durability, [5, 10, 10])

# 模糊化
price_level_low = fuzz.interp_membership(price, price_low, 3)
price_level_medium = fuzz.interp_membership(price, price_medium, 6)
price_level_high = fuzz.interp_membership(price, price_high, 9)

appearance_level_poor = fuzz.interp_membership(appearance, appearance_poor, 2)
appearance_level_average = fuzz.interp_membership(appearance, appearance_average, 5)
appearance_level_good = fuzz.interp_membership(appearance, appearance_good, 8)

functionality_level_poor = fuzz.interp_membership(functionality, functionality_poor, 4)
functionality_level_average = fuzz.interp_membership(functionality, functionality_average, 7)
functionality_level_good = fuzz.interp_membership(functionality, functionality_good, 10)

durability_level_poor = fuzz.interp_membership(durability, durability_poor, 3)
durability_level_average = fuzz.interp_membership(durability, durability_average, 6)
durability_level_good = fuzz.interp_membership(durability, durability_good, 9)

# 构建规则
rule1 = np.fmax(price_level_low, np.fmax(appearance_level_poor, np.fmax(functionality_level_poor, durability_level_poor)))
rule2 = np.fmax(price_level_low, np.fmax(appearance_level_poor, np.fmax(functionality_level_average, durability_level_poor)))
rule3 = np.fmax(price_level_medium, np.fmax(appearance_level_average, np.fmax(functionality_level_good, durability_level_good)))
rule4 = np.fmax(price_level_high, np.fmax(appearance_level_good, np.fmax(functionality_level_good, durability_level_good)))

# 求解模糊综合评价
result = np.fmax(rule1, np.fmax(rule2, np.fmax(rule3, rule4)))

# 解模糊化
defuzzified = fuzz.defuzz(price, result, 'centroid')

# 打印评价结果
print("综合评价结果:", defuzzified)

在这个例子中,我们定义了价格、外观、功能和耐久性的评价指标,并使用三角隶属函数表示不同的评价等级。然后,我们将评价指标进行模糊化,并通过规则推理得到综合评价结果。最后,使用解模糊化方法(在这里使用的是质心法)将模糊结果转化为具体的数值。

请注意,在实际应用中,你需要根据具体问题和数据进行适当的调整和扩展。

3.总结

(1)解决问题
模糊综合评价法是在模糊环境下,考虑了多因素的影响,为了某种目的对一事物作出综合决策的方法。

(2)优点
模糊综合评价法具有结果清晰,系统性强的特点,能较好地解决模糊的、难以量化的问题,适合各种非确定性问题的解决。

(3)缺点
计算复杂,对指标权重矢量的确定主观性较强。
当指标集U较大,即指标集个数凡较大时,在权矢量和为1的条件约束下,相对隶属度权系数往往偏小,权矢量与模糊矩阵R不匹配,结果会出现超模糊现象,分辨率很差,无法区分谁的隶属度更高,甚至造成评判失败,此时可用分层模糊评估法加以改进。

你可能感兴趣的:(数学建模,数学建模)