| fire | R Documentation |
Given a data frame or matrix of truth values for predicates, compute the truth values of a set of conditions expressed as elementary conjunctions.
fire(x, condition, t_norm = "goguen")
x |
A matrix or data frame containing predicate truth values. If |
condition |
A character vector of conditions, each formatted according
to |
t_norm |
A string specifying the triangular norm (t-norm) used to
compute conjunctions of predicate values. Must be one of |
Each element of condition must be a character string of the format
"{p1,p2,p3}", where "p1", "p2", and "p3" are predicate names. The
data object x must contain columns whose names correspond exactly to all
predicates referenced in the conditions. Each condition is evaluated for
every row of x as a conjunction of its predicates, with the conjunction
operation determined by the t_norm argument. An empty condition ("{}")
is always evaluated as 1 (i.e., fully true).
A numeric matrix with entries in the interval [0, 1] giving
the truth degrees of the conditions. The matrix has nrow(x) rows and
length(condition) columns. The element in row i and column j
corresponds to the truth degree of the j-th condition evaluated on the
i-th row of x.
Michal Burda
format_condition(), partition()
d <- data.frame(
a = c(1, 0.8, 0.5, 0.2, 0),
b = c(0.5, 1, 0.5, 0, 1),
c = c(0.9, 0.9, 0.1, 0.8, 0.7)
)
# Evaluate conditions with different t-norms
fire(d, c("{a,c}", "{}", "{a,b,c}"), t_norm = "goguen")
fire(d, c("{a,c}", "{a,b}"), t_norm = "goedel")
fire(d, c("{b,c}"), t_norm = "lukas")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.