5

Matlab 模糊逻辑工具箱,提供模糊推理系统建模。. 是否有所有工具箱的 R 等效项或某些 R 函数,例如:

  1. readfis() : 从文件加载模糊推理系统
  2. evalfis () : 进行模糊推理计算

读取和评估 R 中的模糊系统?

4

2 回答 2

15

看看sets package 它可以完成您对模糊逻辑工具箱的所有期望。它允许指定您的模糊隶属函数,设置您的模糊规则,进行模糊推理和去模糊化。?fuzzy_inference 中的示例显示了标准模糊逻辑教科书的餐厅示例。我强烈推荐它。

## set universe
sets_options("universe", seq(from = 0, to = 25, by = 0.1))

## set up fuzzy variables
variables <-
set(service = fuzzy_partition(varnames = c(poor = 0, good = 5, excellent = 10), sd = 1.5),
food = fuzzy_variable(rancid = fuzzy_trapezoid(corners = c(-2, 0, 2, 4)),
                      delicious = fuzzy_trapezoid(corners = c(7, 9, 11, 13))),
tip = fuzzy_partition(varnames = c(cheap = 5, average = 12.5, generous = 20),
                      FUN = fuzzy_cone, radius = 5)
)

## set up rules
rules <-
set(
fuzzy_rule(service %is% poor || food %is% rancid, tip %is% cheap),
fuzzy_rule(service %is% good, tip %is% average),
fuzzy_rule(service %is% excellent || food %is% delicious, tip %is% generous)
)

## combine to a system
system <- fuzzy_system(variables, rules)
print(system)
plot(system) ## plots variables

## do inference
fi <- fuzzy_inference(system, list(service = 3, food = 8))

## plot resulting fuzzy set
plot(fi)

## defuzzify
gset_defuzzify(fi, "centroid")

## reset universe
sets_options("universe", NULL)

在此处输入图像描述

于 2013-03-04T10:24:03.900 回答
1

您可以使用 FuzzyToolkitUoN 包。我相信它是由诺丁汉大学的 JM Garibaldi 和其他人开发的。

源代码可在他的网站上找到:http: //ima.ac.uk/garibaldi

并且作品在这里发表。

于 2013-08-28T21:46:06.517 回答