使用相同半径时丢失模糊集

Fuzzy sets dropped when using the same radius

提问人:coolhand 提问时间:11/17/2023 更新时间:11/17/2023 访问量:14

问:

当我将所有变量设置为具有相同的半径时,模型中只保留一个:

library(sets)
sets_options("universe", seq(from = 0, to = 100, by = 0.1))
variables <- set(
  var1 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                        FUN = fuzzy_cone, radius = 50),
  var2 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                        FUN = fuzzy_cone, radius = 50),
  var3 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                         FUN = fuzzy_cone, radius = 50),
  score = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                          FUN = fuzzy_cone, radius = 50) 
)

rules <- set(
  fuzzy_rule(var1 %is% low, score %is% low),
  fuzzy_rule(var3 %is% high && var1 %is% medium, score %is% low),
  fuzzy_rule(var2 %is% medium && var3 %is% medium, score %is% medium),
  fuzzy_rule(var1 %is% medium && var2 %is% medium, score %is% medium),
  fuzzy_rule(var1 %is% high, score %is% high)
)

model <- fuzzy_system(variables, rules)
print(model)

A fuzzy system consisting of 1 variables and 5 rules.

Variables:
# MY VARIABLES VAR2, VAR3, & SCORE ARE GONE!
var1(low, medium, high)

Rules:

var1 %is% medium && var2 %is% medium => score %is% medium
var2 %is% medium && var3 %is% medium => score %is% medium
var3 %is% high && var1 %is% medium => score %is% low
var1 %is% low => score %is% low
var1 %is% high => score %is% high

但是,当我将半径更改为全部唯一时,所有变量都会显示:

sets_options("universe", seq(from = 0, to = 100, by = 0.1))
variables <- set(
  var1 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                        FUN = fuzzy_cone, radius = 50),
  var2 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                        FUN = fuzzy_cone, radius = 49.999),
  var3 = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                         FUN = fuzzy_cone, radius = 49.99),
  score = fuzzy_partition(varnames = c(low = 0, medium = 50, high = 100),
                          FUN = fuzzy_cone, radius = 49.9) 
)

rules <- set(
  fuzzy_rule(var1 %is% low, score %is% low),
  fuzzy_rule(var3 %is% high && var1 %is% medium, score %is% low),
  fuzzy_rule(var2 %is% medium && var3 %is% medium, score %is% medium),
  fuzzy_rule(var1 %is% medium && var2 %is% medium, score %is% medium),
  fuzzy_rule(var1 %is% high, score %is% high)
)

model <- fuzzy_system(variables, rules)
print(model)

A fuzzy system consisting of 4 variables and 5 rules.

Variables:

var1(low, medium, high)
var2(low, medium, high)
var3(low, medium, high)
score(low, medium, high)

Rules:

var1 %is% medium && var2 %is% medium => score %is% medium
var2 %is% medium && var3 %is% medium => score %is% medium
var3 %is% high && var1 %is% medium => score %is% low
var1 %is% low => score %is% low
var1 %is% high => score %is% high

为什么我无法构建具有相似 universe/隶属函数的模型?

r 模糊逻辑

评论


答: 暂无答案