Hi,

I just discovered the package "sets" and its ability to perform fuzzy
systems calculations.

The example in the manual of fuzzyinference() gives an overview how to
develop rules.
However my "rules" are already available as data.frame and I'd like to
convert them into the format
that is needed by fuzzy_rules.

Here how the rules would be defined manually:

rules <-
  set(
    fuzzy_rule(depth %is% low && velocity %is% medium, suitability %is%
low),
    fuzzy_rule(depth %is% medium && velocity %is% medium, suitability %is%
medium),
    fuzzy_rule(depth %is% high && velocity %is% low, suitability %is% low)
  )

In my case I have the rules in following dataframe where a combination of
depth and velocity (&&)
result in a certain suitability. So every single row is actually a rule:

df <-
data.frame(depth=c("low","medium","high"),velocity=c("medium","medium","low"),suitability=c("low","medium","low"))

Is there an easy way to combine the columns per row in a way that in the
end I get the same format
as the object "rules"? As a single rule (fuzzy_rule) is not a pure text
string I don't know how to do that resp. to combine
all rules/rows into a set().

Any suggestions?

Best regards,
Johannes

	[[alternative HTML version deleted]]

