Learn R Programming

lfl

The lfl package provides various algorithms related to linguistic fuzzy logic: mining for linguistic fuzzy association rules, composition of fuzzy relations, performing perception-based logical deduction (PbLD), and forecasting time-series using fuzzy rule-based ensemble (FRBE). The package also contains basic fuzzy-related algebraic functions capable of handling missing values in different styles (Bochvar, Sobocinski, Kleene etc.), computation of Sugeno integrals and fuzzy transform.

Documentation

The complete documentation of the package is available in this vignette.

Installation

To install the stable version from CRAN, simply issue the following command within your R session:

install.packages("lfl")

If you want to install the development version instead, type:

install.packages("devtools")
devtools::install_github("beerda/lfl")

Copy Link

Version

Install

install.packages('lfl')

Monthly Downloads

618

Version

2.3.0

License

GPL-3

Maintainer

Michal Burda

Last Published

June 27th, 2025

Functions in lfl (2.3.0)

as.data.frame.fsets

Convert an object of fsets class into a matrix or data frame This function converts an instance of S3 class fsets into a matrix or a data frame. The vars() and specs() attributes of the original object are deleted.
as.data.frame.farules

cbind.fsets

Combine several 'fsets' objects into a single one
c.farules

Take a sequence of instances of S3 class farules() and combine them into a single object. An error is thrown if some argument does not inherit from the farules() class.
antecedents

Extract antecedent-part (left-hand side) of rules in a list
compose

Composition of Fuzzy Relations
consequents

Extract consequent-part (right-hand side) of rules in a list
algebra

Algebra for Fuzzy Sets
sobocinski

Modify algebra's way of computing with NA values.
aggregateConsequents

Aggregation of fired consequents into a resulting fuzzy set
frbe

Fuzzy Rule-Based Ensemble (FRBE) of time-series forecasts
ctx

Context for linguistic expressions
equifreq

Return equifrequent breaks
farules

Create an instance of S3 class farules which represents a set of fuzzy association rules and their statistical characteristics.
evalfrbe

Evaluate the performance of the FRBE forecast
fire

Evaluate rules and obtain truth-degrees
fcut

Transform data into a fsets S3 class using shapes derived from triangles or raised cosines
defaultHedgeParams

A list of the parameters that define the shape of the hedges.
is.ft

Test whether x is a valid object of the S3 ft class
defuzz

Convert fuzzy set into a crisp numeric value
ftinv

Inverse of the fuzzy transform
horizon

Create a function that computes linguistic horizons
is.farules

Test whether x inherits from the S3 farules class.
equidist

Return equidistant breaks
is.specific

Determine whether the first set x of predicates is more specific (or equal) than y with respect to vars and specs.
minmax

Creating linguistic context directly from values
lfl-package

lfl - Linguistic Fuzzy Logic
fsets

S3 class representing a set of fuzzy sets on the fixed universe
ft

Fuzzy transform
mase

Compute Mean Absolute Scaled Error (MASE)
lingexpr

Creator of functions representing linguistic expressions
mult

Callback-based Multiplication of Matrices
print.fsets

Print an instance of the fsets() class
lcut

Transform data into a fsets S3 class of linguistic fuzzy attributes
slices

Return vector of values from given interval
print.frbe

Print an instance of the frbe() class
print.ctx3

Print the linguistic context
quantifier

A quantifier is a function that computes a fuzzy truth value of a claim about the quantity. This function creates the <1>-type quantifier. (See the examples below on how to use it as a quantifier of the <1,1> type.)
hedge

Linguistic hedges
searchrules

Searching for fuzzy association rules
print.algebra

Print an instance of the algebra() S3 class in a human readable form.
rbcoverage

Compute rule base coverage of data
is.frbe

Test whether x is a valid object of the S3 frbe class
plot.fsets

Plot membership degrees stored in the instance of the S3 class fsets() as a line diagram.
pbld

Perform a Perception-based Logical Deduction (PbLD) with given rule-base on given dataset
smape

Compute Symmetric Mean Absolute Percentage Error (SMAPE)
perceive

From a set of rules, remove each rule for which another rule exists that is more specific.
print.farules

Print an instance of the farules() S3 class in a human readable form.
is.fsets

Test whether x is a valid object of the S3 fsets class
reduce

Reduce the size of rule base
rmse

Compute Root Mean Squared Error (RMSE)
triangular

Factories for functions that convert numeric data into membership degrees of fuzzy sets
str.fsets

Compactly display the internal structure of an instance of the fsets() class
triangle

Deprecated functions to compute membership degrees of numeric fuzzy sets
sugeno

A factory function for creation of sugeno-integrals.