Fuzzy logic function in R, as in Matlab

The Fuzzy Logic Toolbox Matlab introduces Fuzzy Logic Modeling. . Is there an R-equivalent of the entire toolbox or some R function, for example:

  • readfis () : load the Fuzzy Inference system from a file
  • evalfis (): perform fuzzy output calculations

read and evaluate a fuzzy system inside R?

+6
source share
2 answers

Check out the sets package It does everything you expect from a fuzzy logic toolkit. It allows you to define your functions of fuzzy membership, configure your fuzzy rules, draw fuzzy conclusions and deactivate. Example in? Fuzzy_inference shows an example of a restaurant standard textbook on fuzzy logic. I highly recommend it.

 ## 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) 

enter image description here

+15
source

You can use the FuzzyToolkitUoN package. I believe that it was developed by J. M. Garibaldi and others at the University of Nottingham.

The source code is available on its website: http://ima.ac.uk/garibaldi

And the work was published here .

+1
source

All Articles