The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
This package is the R implementation of functions to manage a Fuzzy
Inference System (FIS) provided by the open source software FisPro.
FisPro
allows to create Fuzzy Inference Systems and to use them for reasoning
purposes, especially for simulating a physical or biological system.
In this brief User Guide we describe how to build and use a FIS to infer
input values.
See Fuzzy
Logic Elementary Glossary for more details about Fuzzy Logic.
library(FisPro)
The FIS configuration file can be designed using the FisPro open source software.
<- system.file("extdata", "test.fis", package = "FisPro")
fis_file <- NewFis(fis_file) fis
Create a new empty FIS.
The design must be completed using the
available functions to add inputs, outputs and rules before it can be
used for inference.
<- NewFis()
fis $name <- "foo" fis
Add 2 inputs to the FIS.
Create the first input with 2 MFs regular standardized fuzzy partition:
<- NewFisIn(2, 0, 1)
fisin1 $name <- "input1"
fisin1$add_input(fisin1) fis
Create the second input with 3 MFs:
<- NewFisIn(0, 1)
fisin2 $name <- "input2"
fisin2
<- NewMfTrapezoidalInf(0, 0.5)
mf1 $label <- "Low"
mf1$add_mf(mf1)
fisin2
<- NewMfTriangular(0, 0.5, 1)
mf2 $label <- "Average"
mf2$add_mf(mf2)
fisin2
<- NewMfTrapezoidalSup(0.5, 1)
mf3 $label <- "High"
mf3$add_mf(mf3)
fisin2
$add_input(fisin2) fis
Add 2 outputs to the FIS.
Create a crisp output with range [0, 1]:
<- NewFisOutCrisp(0, 1)
fisout1 $name <- "output1"
fisout1$add_output(fisout1) fis
Create a fuzzy output with 2 MFs regular standardized fuzzy partition in range [0, 1]:
<- NewFisOutFuzzy(2, 0, 1)
fisout2 $name <- "output2"
fisout2$add_output(fisout2) fis
Add 2 rules to the FIS.
Each rule is initialized with a vector of
premises and conclusions.
- a premise is the 1-based index of MF in
the input [FisIn], 0 means the rule is incompelete.
- a conclusion
is a numeric value for crisp output [FisOutCrisp], or the 1-based index
of MF in the fuzzy output [FisOutFuzzy].
In this example the second
rule is incomplete, the second input of the FIS has no effect on this
rule.
$add_rule(NewRule(c(1, 2), c(0, 1)))
fis$add_rule(NewRule(c(2, 0), c(1, 2))) fis
Save the FIS to the file “foo.fis”:
$save("foo.fis") fis
Infers all outputs:
<- fis$infer(c(0.25, 0.75)) inferred
Infers first output:
<- fis$infer_output(c(0.25, 0.75), 1) inferred_output1
Infers second output:
<- fis$infer_output(c(0.25, 0.75), 2) inferred_output2
Infers dataset:
<- system.file("extdata", "test_data.csv", package = "FisPro")
test_file <- read.csv(test_file)
dataset <- fis$infer(dataset) inferred_dataset
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.