API reference¶
One page per module. Every public name is listed here with its one-line summary and a link to its full entry (signature, arguments, exceptions and runnable examples). The table is generated from the package at build time, so it cannot fall out of date.
The fuzzy number classes are also importable from the package root
(from bulanik import TFN); everything else is imported from its module
(from bulanik.mcdm import topsis).
| Module | Contents |
|---|---|
bulanik.numbers |
Fuzzy number types: triangular, orthopair, three-part, interval-valued and interval type-2 |
bulanik.aggregate |
Weighted average, weighted geometric mean, expert aggregation |
bulanik.sets |
Membership functions, linguistic variables, t-norms |
bulanik.scales |
Linguistic scales and the built-in ones |
bulanik.inference |
Rules, Mamdani, Sugeno and Tsukamoto systems |
bulanik.type2 |
Interval type-2 sets, systems and type reduction |
bulanik.anfis |
Adaptive neuro-fuzzy inference |
bulanik.mcdm |
Weighting, ranking, outranking, DEMATEL and fuzzy ranking |
bulanik.lumix |
LumiX bridge (lumix extra) |
bulanik.sezgi |
sezgi bridge (sezgi extra) |
bulanik.plot |
Figures (plot extra) |
bulanik.numbers
Full entries: bulanik.numbers
| Name | Kind | Summary |
|---|---|---|
FFN | class | Fermatean fuzzy number \((\mu, \nu)\) with \(\mu^3 + \nu^3 \le 1\) (q = 3, Senapati and Yager 2020). |
FuzzyNumber | class | Common interface of fuzzy numbers. |
IFN | class | Intuitionistic fuzzy number \((\mu, \nu)\) with \(\mu + \nu \le 1\) (q = 1, Atanassov 1986). |
IT2TrFN | class | Interval type-2 trapezoidal fuzzy number \((\tilde A^U, \tilde A^L)\). |
IVFFN | class | Interval-valued Fermatean fuzzy number with \(\mu_U^3 + \nu_U^3 \le 1\) (q = 3, Jeevaraj 2021). |
IVIFN | class | Interval-valued intuitionistic fuzzy number with \(\mu_U + \nu_U \le 1\) (q = 1, Atanassov and Gargov 1989). |
IVNeutrosophicFN | class | Interval neutrosophic number \(\langle [t_L, t_U], [i_L, i_U], [f_L, f_U] \rangle\). |
IVPFN | class | Interval-valued Pythagorean fuzzy number with \(\mu_U^2 + \nu_U^2 \le 1\) (q = 2, Peng and Yang 2016). |
IVQROFN | class | Interval-valued q-rung orthopair fuzzy number \(([\mu_L, \mu_U], [\nu_L, \nu_U])\). |
NeutrosophicFN | class | Single-valued neutrosophic number \((t, i, f)\), each part in \([0, 1]\). |
PFN | class | Pythagorean fuzzy number \((\mu, \nu)\) with \(\mu^2 + \nu^2 \le 1\) (q = 2, Yager 2013). |
PictureFN | class | Picture fuzzy number \((\mu, \eta, \nu)\) with \(\mu + \eta + \nu \le 1\). |
QROFN | class | q-rung orthopair fuzzy number \((\mu, \nu)\) with \(\mu^q + \nu^q \le 1\). |
SphericalFN | class | Spherical fuzzy number \((\mu, \nu, \pi)\) with \(\mu^2 + \nu^2 + \pi^2 \le 1\). |
TFN | class | Triangular fuzzy number \((l, m, u)\) with \(l \le m \le u\). |
TrFN | class | Trapezoidal fuzzy number \((a, b, c, d)\) with \(a \le b \le c \le d\). |
bulanik.aggregate
Full entries: bulanik.aggregate
| Name | Kind | Summary |
|---|---|---|
aggregate_experts | function | Aggregate expert ratings indexed [expert][alternative][criterion]. |
wa | function | Weighted average \(\sum_i w_i A_i\) with the type's own operators. |
wg | function | Weighted geometric mean \(\prod_i A_i^{w_i}\) with the type's own operators. |
bulanik.sets
Full entries: bulanik.sets
| Name | Kind | Summary |
|---|---|---|
bell | function | Generalized bell \(\dfrac{1}{1 + \lvert (x - c)/a \rvert^{2b}}\) with \(a > 0\), \(b > 0\). |
gaussian | function | Gaussian \(\exp\!\left(-\frac{(x - \text{mean})^2}{2\sigma^2}\right)\) with \(\sigma > 0\). |
linear_decreasing | function | Ramp down: 1 for x <= a, 0 for x >= b, linear in between (a < b). |
linear_increasing | function | Ramp up: 0 for x <= a, 1 for x >= b, linear in between (a < b). |
LinguisticVariable | class | A named variable on a universe (lo, hi) with named fuzzy terms. |
MembershipFunction | class | A membership function \(\mu: \mathbb{R} \to [0, 1]\) of a named kind. |
sigmoid | function | Sigmoid \(\dfrac{1}{1 + e^{-\text{slope}\,(x - \text{center})}}\) with \(\text{slope} \ne 0\). |
SIGMOID_EPS | constant | Sigmoid memberships never reach exactly 0 or 1, so inverse of a sigmoid clamps alpha into \([\varepsilon, 1 - \varepsilon]\) with \(\varepsilon = 10^{-9}\) instead of returning \(\pm\infty\). |
t_conorm | function | Fuzzy OR (t-conorm): "max" \(\max(a, b)\) or "probor" \(a + b - ab\). |
t_norm | function | Fuzzy AND (t-norm): "min" \(\min(a, b)\) or "prod" \(a\,b\). |
trapezoidal | function | Trapezoid with plateau [b, c] (a <= b <= c <= d, a < d). |
triangular | function | Triangle with feet a, c and peak b (a <= b <= c, a < c). |
bulanik.scales
Full entries: bulanik.scales
| Name | Kind | Summary |
|---|---|---|
EXAMPLE_IFN_5 | constant | Example 5-term intuitionistic scale (VL, L, M, H, VH); illustrative values with no source. |
EXAMPLE_IFN_7 | constant | Example 7-term intuitionistic scale (EL, VL, L, M, H, VH, EH); illustrative values with no source. |
EXAMPLE_TFN_7 | constant | Example 7-term triangular rating scale on 0-10 (VP, P, MP, F, MG, G, VG); illustrative values with no source. |
FUZZY_BWM_TFN | constant | The fuzzy best-worst method scale of Guo and Zhao (2017, Knowledge-Based Systems 121:23-31): equally (EI), weakly (WI), fairly (FI), very (VI) and absolutely (AI) important, as triangular numbers. |
LinguisticScale | class | An ordered set of linguistic terms, all fuzzy numbers of one type. |
SAATY_TFN | constant | Saaty's 1-9 scale as triangular numbers: "1" = (1,1,1), "k" = (k-1,k,k+1) for k = 2..8, "9" = (9,9,9). |
bulanik.inference
Full entries: bulanik.inference
| Name | Kind | Summary |
|---|---|---|
And | class | Conjunction of antecedents (AND); nested conjunctions are flattened. |
Antecedent | constant | An antecedent expression: a Term, or an And / Or of antecedents. |
defuzzify_samples | function | Crisp value of a sampled fuzzy set. |
Explanation | class | Everything behind one evaluation: degrees, rule activations and outputs. |
firing_strength | function | Degree to which an antecedent holds. |
Linear | class | First-order Sugeno consequent \(c_0 + \sum_i c_i x_i\) over named inputs. |
MamdaniFIS | class | Mamdani fuzzy inference system (Mamdani and Assilian 1975). |
NoRuleFiredError | class | No rule fired for an output and no default value was given. |
Or | class | Disjunction of antecedents (OR); nested disjunctions are flattened. |
parse_rule | function | Parse rule text IF ... THEN ... [WITH w] into a Rule. |
Rule | class | IF antecedent THEN consequents [WITH weight]. |
rule_terms | function | All Term leaves of an antecedent, left to right. |
RuleActivation | class | A rule's firing level: weight times antecedent degree. |
SugenoFIS | class | Sugeno fuzzy inference system (Takagi and Sugeno 1985). |
SugenoOutput | class | Output variable whose terms are constants (zero-order) or Linear (first-order). |
Term | class | The atom variable IS term, or variable IS NOT term when negated. |
TsukamotoFIS | class | Tsukamoto fuzzy inference system (Tsukamoto 1979). |
bulanik.type2
Full entries: bulanik.type2
| Name | Kind | Summary |
|---|---|---|
gaussian_uncertain_mean | function | Gaussian with a mean anywhere in \([m_1, m_2]\) (Mendel 2001). |
gaussian_uncertain_sigma | function | Gaussian with a width anywhere in \([\sigma_1, \sigma_2]\). |
IT2LinguisticVariable | class | A named variable on a universe (lo, hi) with interval type-2 terms. |
IT2MamdaniFIS | class | Interval type-2 Mamdani system with the centroid type reducer. |
IT2MF | class | Interval type-2 membership function bounded by two type-1 functions. |
IT2SugenoFIS | class | Interval type-2 Sugeno system with the centre-of-sets type reducer. |
NoLowerFiringError | class | bmm type reduction needs a positive lower weight and every one is 0. |
scaled_triangle | function | Triangle \(\operatorname{tri}(a, b, c)\) over a lower triangle \(h \cdot \operatorname{tri}(a, b, c)\). |
type_reduce | function | Reduce points ys with interval weights [lower, upper] to a crisp value. |
TypeReduced | class | Type-reduced interval [left, right] and the crisp output. |
bulanik.anfis
Full entries: bulanik.anfis
| Name | Kind | Summary |
|---|---|---|
ANFIS | class | Grid-partition first-order Sugeno ANFIS (Jang 1993). |
ExtrapolationWarning | class | ANFIS.predict was asked about inputs outside the trained ranges. |
MIN_B | constant | Training floors the bell exponent b at MIN_B. |
MIN_WIDTH | constant | Training floors a width (Gaussian sigma, bell a) at MIN_WIDTH * (hi - lo) of its input. |
bulanik.mcdm
Full entries: bulanik.mcdm
| Name | Kind | Summary |
|---|---|---|
ahp | function | Saaty's AHP: principal-eigenvector weights and consistency ratio. |
ahp_fuzzy_numbers | function | AHP over a comparison matrix of any one fuzzy number kind. |
ahp_interval_valued | function | Interval-valued AHP over a comparison matrix of one IVQROFN kind. |
BWMResult | class | Best-worst method weights (ranking is best first). |
cocoso | function | CoCoSo (Yazdani et al. 2019): combined compromise solution. |
codas | function | CODAS (Keshavarz Ghorabaee et al. 2016): distances from the negative-ideal point. |
copras | function | COPRAS (Zavadskas, Kaklauskas & Sarka 1994): complex proportional assessment. |
critic | function | CRITIC objective weights (Diakoulaki, Mavrotas & Papayannakis 1995). |
DecisionMatrix | class | Expert ratings [expert][alternative][criterion] of one fuzzy number kind. |
dematel | constant | DEMATEL: crisp and fuzzy (CFCS) influence analysis. |
DEMATELResult | class | DEMATEL influence analysis: total-relation matrix, cause/effect groups and weights. |
edas | function | EDAS (Keshavarz Ghorabaee et al. 2015): distance from the average solution. |
electre | function | ELECTRE I (Roy 1968) with a complete ranking from net concordance and discordance. |
entropy | function | Shannon-entropy objective weights from a decision matrix. |
fuzzy_ahp | function | Buckley's fuzzy AHP (geometric mean of rows) with TFN judgements. |
fuzzy_cocoso | function | CoCoSo on fuzzy numbers: weighted sum and weighted product as numbers, scored, then compromised. |
fuzzy_codas | function | CODAS on fuzzy numbers: distances of the weighted numbers from the negative-ideal numbers. |
fuzzy_topsis | function | Fuzzy TOPSIS of Chen (2000) on triangular fuzzy numbers. |
fuzzy_waspas | function | WASPAS on fuzzy numbers: weighted sum and weighted product combined as numbers, then scored. |
marcos | function | MARCOS (Stevic et al. 2020): measurement of alternatives and ranking according to compromise solution. |
piprecia | function | PIPRECIA (Stanujkic et al. 2017) and its fully fuzzy form (Stevic et al. 2018). |
rank_fuzzy | function | Aggregate experts, score the fuzzy numbers, then rank with a crisp method. |
RankingResult | class | Alternative scores and their ranking (ranking is best first). |
swara | function | SWARA (Kersuliene et al. 2010); criteria are listed most important first. |
topsis | function | TOPSIS (Hwang & Yoon 1981) with vector normalisation, Euclidean distance. |
vikor | function | VIKOR (Opricovic & Tzeng 2004); v is the weight of group utility. |
waspas | function | WASPAS (Zavadskas et al. 2012): lam * WSM + (1 - lam) * WPM. |
WeightingResult | class | Criteria weights from a weighting method (ranking is best first). |
wisp | function | WISP (Stanujkic et al. 2023): integrated simple weighted sum product method. |
bulanik.mcdm.bwm
Full entries: bulanik.mcdm.bwm
| Name | Kind | Summary |
|---|---|---|
bwm_consistency_index | function | Rezaei's (2015) consistency index for a best-over-worst comparison. |
fuzzy_bwm_consistency_index | function | Guo & Zhao's (2017) consistency index for a fuzzy best-over-worst comparison. |
resolve_best_worst | function | Validate BWM comparison vectors and resolve the best and worst criteria. |
bulanik.lumix
Full entries: bulanik.lumix
| Name | Kind | Summary |
|---|---|---|
bwm_linear | function | Linear best-worst method (Rezaei 2016, Omega 64:126-130). |
FuzzyGoal | class | A fuzzy goal on a linear expression \(z\) (Zimmermann 1978). |
ScoreRecord | class | One scored item. |
scores_as_data | function | MCDM scores as records for LXVariable(...).from_data(records). |
solve_zimmermann | function | Build the Zimmermann model on model and solve it. |
zimmermann | function | Add Zimmermann's max-min fuzzy goal rows to model and return it. |
ZimmermannResult | class | Outcome of solve_zimmermann. |
bulanik.sezgi
Full entries: bulanik.sezgi
| Name | Kind | Summary |
|---|---|---|
ANFISProblem | class | Training RMSE of an ANFIS as a sezgi problem. |
ANFISTrainResult | class | Outcome of train_anfis. |
BWMProblem | class | Rezaei's (2015, Omega 53:49-57) nonlinear best-worst method. |
FuzzyBWMProblem | class | Guo & Zhao's (2017, Knowledge-Based Systems 121:23-31) fuzzy best-worst method. |
train_anfis | function | Train a deep copy of anfis with sezgi; anfis itself is untouched. |
bulanik.plot
Full entries: bulanik.plot
| Name | Kind | Summary |
|---|---|---|
alpha_cuts | function | The \(\alpha\)-cuts of a number as stacked horizontal intervals. |
current_theme | function | The tokens of the active theme, as a read-only mapping. |
defuzzification | function | A number with markers at the crisp values of its score functions. |
dematel | function | DEMATEL cause-effect diagram: prominence against relation, with the strong influences. |
it2_number | function | Interval type-2 trapezoidal numbers: upper and lower trapezoids and the footprint between them. |
it2_set | function | Footprint of uncertainty of interval type-2 sets. |
iv_orthopair | function | Interval-valued orthopair numbers as rectangles in the \(\mu\)–\(\nu\) plane. |
mamdani_output | function | How a Mamdani system reaches its crisp output for one set of inputs. |
membership | function | Membership functions of triangular and trapezoidal numbers on one axis. |
neutrosophic | function | Neutrosophic numbers as \(T\)/\(I\)/\(F\) radar triangles. |
orthopair | function | Orthopair numbers as points in the \(\mu\)–\(\nu\) plane with their feasible regions. |
PALETTE | constant | The categorical palette: eight hues in a fixed order, one tuple per theme. |
picture | function | Picture fuzzy numbers on the \(\mu\)–\(\eta\)–\(\nu\) ternary simplex. |
ranking | function | Alternatives sorted best first, as a dot plot of their scores. |
spherical | function | Spherical fuzzy numbers inside the positive octant of the unit sphere. |
surface | function | Input-output map of a fuzzy system: a 3-D surface (2 inputs) or a curve (1 input). |
theme | function | Context manager that applies the house style in a light or dark variant. |
variable | function | Every term of a linguistic variable or scale, direct-labelled. |
weights | function | Criteria weights as horizontal bars, largest first, value at each tip. |