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

325

Version

2.3.1

License

GPL-3

Maintainer

Michal Burda

Last Published

December 16th, 2025

Functions in lfl (2.3.1)

ctx

Context for linguistic expressions
frbe

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

A list of the parameters that define the shape of the hedges.
equidist

Return equidistant breaks
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
farules

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

Convert fuzzy set into a crisp numeric value
equifreq

Return equifrequent breaks
is.ft

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

Fuzzy transform
horizon

Create a function that computes linguistic horizons
is.frbe

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

S3 class representing a set of fuzzy sets on the fixed universe
is.specific

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

Linguistic hedges
ftinv

Inverse of the fuzzy transform
is.fsets

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

Test whether x inherits from the S3 farules 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
print.algebra

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

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

Print the linguistic context
minmax

Creating linguistic context directly from values
rmse

Compute Root Mean Squared Error (RMSE)
print.fsets

Print an instance of the fsets() class
lfl-package

lfl - Linguistic Fuzzy Logic
mult

Callback-based Multiplication of Matrices
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.)
reduce

Reduce the size of rule base
lcut

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

Compute Symmetric Mean Absolute Percentage Error (SMAPE)
print.farules

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

Deprecated functions to compute membership degrees of numeric fuzzy sets
rbcoverage

Compute rule base coverage of data
print.frbe

Print an instance of the frbe() class
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
sugeno

A factory function for creation of sugeno-integrals.
mase

Compute Mean Absolute Scaled Error (MASE)
lingexpr

Creator of functions representing linguistic expressions
searchrules

Searching for fuzzy association rules
slices

Return vector of values from given interval
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.
as.data.frame.farules

sobocinski

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

Composition of Fuzzy Relations
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.
algebra

Algebra for Fuzzy Sets
aggregateConsequents

Aggregation of fired consequents into a resulting fuzzy set
consequents

Extract consequent-part (right-hand side) of rules in a list
cbind.fsets

Combine several 'fsets' objects into a single one
antecedents

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