Skip to content

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

NameKindSummary
FFNclassFermatean fuzzy number \((\mu, \nu)\) with \(\mu^3 + \nu^3 \le 1\) (q = 3, Senapati and Yager 2020).
FuzzyNumberclassCommon interface of fuzzy numbers.
IFNclassIntuitionistic fuzzy number \((\mu, \nu)\) with \(\mu + \nu \le 1\) (q = 1, Atanassov 1986).
IT2TrFNclassInterval type-2 trapezoidal fuzzy number \((\tilde A^U, \tilde A^L)\).
IVFFNclassInterval-valued Fermatean fuzzy number with \(\mu_U^3 + \nu_U^3 \le 1\) (q = 3, Jeevaraj 2021).
IVIFNclassInterval-valued intuitionistic fuzzy number with \(\mu_U + \nu_U \le 1\) (q = 1, Atanassov and Gargov 1989).
IVNeutrosophicFNclassInterval neutrosophic number \(\langle [t_L, t_U], [i_L, i_U], [f_L, f_U] \rangle\).
IVPFNclassInterval-valued Pythagorean fuzzy number with \(\mu_U^2 + \nu_U^2 \le 1\) (q = 2, Peng and Yang 2016).
IVQROFNclassInterval-valued q-rung orthopair fuzzy number \(([\mu_L, \mu_U], [\nu_L, \nu_U])\).
NeutrosophicFNclassSingle-valued neutrosophic number \((t, i, f)\), each part in \([0, 1]\).
PFNclassPythagorean fuzzy number \((\mu, \nu)\) with \(\mu^2 + \nu^2 \le 1\) (q = 2, Yager 2013).
PictureFNclassPicture fuzzy number \((\mu, \eta, \nu)\) with \(\mu + \eta + \nu \le 1\).
QROFNclassq-rung orthopair fuzzy number \((\mu, \nu)\) with \(\mu^q + \nu^q \le 1\).
SphericalFNclassSpherical fuzzy number \((\mu, \nu, \pi)\) with \(\mu^2 + \nu^2 + \pi^2 \le 1\).
TFNclassTriangular fuzzy number \((l, m, u)\) with \(l \le m \le u\).
TrFNclassTrapezoidal fuzzy number \((a, b, c, d)\) with \(a \le b \le c \le d\).

bulanik.aggregate

Full entries: bulanik.aggregate

NameKindSummary
aggregate_expertsfunctionAggregate expert ratings indexed [expert][alternative][criterion].
wafunctionWeighted average \(\sum_i w_i A_i\) with the type's own operators.
wgfunctionWeighted geometric mean \(\prod_i A_i^{w_i}\) with the type's own operators.

bulanik.sets

Full entries: bulanik.sets

NameKindSummary
bellfunctionGeneralized bell \(\dfrac{1}{1 + \lvert (x - c)/a \rvert^{2b}}\) with \(a > 0\), \(b > 0\).
gaussianfunctionGaussian \(\exp\!\left(-\frac{(x - \text{mean})^2}{2\sigma^2}\right)\) with \(\sigma > 0\).
linear_decreasingfunctionRamp down: 1 for x <= a, 0 for x >= b, linear in between (a < b).
linear_increasingfunctionRamp up: 0 for x <= a, 1 for x >= b, linear in between (a < b).
LinguisticVariableclassA named variable on a universe (lo, hi) with named fuzzy terms.
MembershipFunctionclassA membership function \(\mu: \mathbb{R} \to [0, 1]\) of a named kind.
sigmoidfunctionSigmoid \(\dfrac{1}{1 + e^{-\text{slope}\,(x - \text{center})}}\) with \(\text{slope} \ne 0\).
SIGMOID_EPSconstantSigmoid 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_conormfunctionFuzzy OR (t-conorm): "max" \(\max(a, b)\) or "probor" \(a + b - ab\).
t_normfunctionFuzzy AND (t-norm): "min" \(\min(a, b)\) or "prod" \(a\,b\).
trapezoidalfunctionTrapezoid with plateau [b, c] (a <= b <= c <= d, a < d).
triangularfunctionTriangle with feet a, c and peak b (a <= b <= c, a < c).

bulanik.scales

Full entries: bulanik.scales

NameKindSummary
EXAMPLE_IFN_5constantExample 5-term intuitionistic scale (VL, L, M, H, VH); illustrative values with no source.
EXAMPLE_IFN_7constantExample 7-term intuitionistic scale (EL, VL, L, M, H, VH, EH); illustrative values with no source.
EXAMPLE_TFN_7constantExample 7-term triangular rating scale on 0-10 (VP, P, MP, F, MG, G, VG); illustrative values with no source.
FUZZY_BWM_TFNconstantThe 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.
LinguisticScaleclassAn ordered set of linguistic terms, all fuzzy numbers of one type.
SAATY_TFNconstantSaaty'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

NameKindSummary
AndclassConjunction of antecedents (AND); nested conjunctions are flattened.
AntecedentconstantAn antecedent expression: a Term, or an And / Or of antecedents.
defuzzify_samplesfunctionCrisp value of a sampled fuzzy set.
ExplanationclassEverything behind one evaluation: degrees, rule activations and outputs.
firing_strengthfunctionDegree to which an antecedent holds.
LinearclassFirst-order Sugeno consequent \(c_0 + \sum_i c_i x_i\) over named inputs.
MamdaniFISclassMamdani fuzzy inference system (Mamdani and Assilian 1975).
NoRuleFiredErrorclassNo rule fired for an output and no default value was given.
OrclassDisjunction of antecedents (OR); nested disjunctions are flattened.
parse_rulefunctionParse rule text IF ... THEN ... [WITH w] into a Rule.
RuleclassIF antecedent THEN consequents [WITH weight].
rule_termsfunctionAll Term leaves of an antecedent, left to right.
RuleActivationclassA rule's firing level: weight times antecedent degree.
SugenoFISclassSugeno fuzzy inference system (Takagi and Sugeno 1985).
SugenoOutputclassOutput variable whose terms are constants (zero-order) or Linear (first-order).
TermclassThe atom variable IS term, or variable IS NOT term when negated.
TsukamotoFISclassTsukamoto fuzzy inference system (Tsukamoto 1979).

bulanik.type2

Full entries: bulanik.type2

NameKindSummary
gaussian_uncertain_meanfunctionGaussian with a mean anywhere in \([m_1, m_2]\) (Mendel 2001).
gaussian_uncertain_sigmafunctionGaussian with a width anywhere in \([\sigma_1, \sigma_2]\).
IT2LinguisticVariableclassA named variable on a universe (lo, hi) with interval type-2 terms.
IT2MamdaniFISclassInterval type-2 Mamdani system with the centroid type reducer.
IT2MFclassInterval type-2 membership function bounded by two type-1 functions.
IT2SugenoFISclassInterval type-2 Sugeno system with the centre-of-sets type reducer.
NoLowerFiringErrorclassbmm type reduction needs a positive lower weight and every one is 0.
scaled_trianglefunctionTriangle \(\operatorname{tri}(a, b, c)\) over a lower triangle \(h \cdot \operatorname{tri}(a, b, c)\).
type_reducefunctionReduce points ys with interval weights [lower, upper] to a crisp value.
TypeReducedclassType-reduced interval [left, right] and the crisp output.

bulanik.anfis

Full entries: bulanik.anfis

NameKindSummary
ANFISclassGrid-partition first-order Sugeno ANFIS (Jang 1993).
ExtrapolationWarningclassANFIS.predict was asked about inputs outside the trained ranges.
MIN_BconstantTraining floors the bell exponent b at MIN_B.
MIN_WIDTHconstantTraining floors a width (Gaussian sigma, bell a) at MIN_WIDTH * (hi - lo) of its input.

bulanik.mcdm

Full entries: bulanik.mcdm

NameKindSummary
ahpfunctionSaaty's AHP: principal-eigenvector weights and consistency ratio.
ahp_fuzzy_numbersfunctionAHP over a comparison matrix of any one fuzzy number kind.
ahp_interval_valuedfunctionInterval-valued AHP over a comparison matrix of one IVQROFN kind.
BWMResultclassBest-worst method weights (ranking is best first).
cocosofunctionCoCoSo (Yazdani et al. 2019): combined compromise solution.
codasfunctionCODAS (Keshavarz Ghorabaee et al. 2016): distances from the negative-ideal point.
coprasfunctionCOPRAS (Zavadskas, Kaklauskas & Sarka 1994): complex proportional assessment.
criticfunctionCRITIC objective weights (Diakoulaki, Mavrotas & Papayannakis 1995).
DecisionMatrixclassExpert ratings [expert][alternative][criterion] of one fuzzy number kind.
dematelconstantDEMATEL: crisp and fuzzy (CFCS) influence analysis.
DEMATELResultclassDEMATEL influence analysis: total-relation matrix, cause/effect groups and weights.
edasfunctionEDAS (Keshavarz Ghorabaee et al. 2015): distance from the average solution.
electrefunctionELECTRE I (Roy 1968) with a complete ranking from net concordance and discordance.
entropyfunctionShannon-entropy objective weights from a decision matrix.
fuzzy_ahpfunctionBuckley's fuzzy AHP (geometric mean of rows) with TFN judgements.
fuzzy_cocosofunctionCoCoSo on fuzzy numbers: weighted sum and weighted product as numbers, scored, then compromised.
fuzzy_codasfunctionCODAS on fuzzy numbers: distances of the weighted numbers from the negative-ideal numbers.
fuzzy_topsisfunctionFuzzy TOPSIS of Chen (2000) on triangular fuzzy numbers.
fuzzy_waspasfunctionWASPAS on fuzzy numbers: weighted sum and weighted product combined as numbers, then scored.
marcosfunctionMARCOS (Stevic et al. 2020): measurement of alternatives and ranking according to compromise solution.
pipreciafunctionPIPRECIA (Stanujkic et al. 2017) and its fully fuzzy form (Stevic et al. 2018).
rank_fuzzyfunctionAggregate experts, score the fuzzy numbers, then rank with a crisp method.
RankingResultclassAlternative scores and their ranking (ranking is best first).
swarafunctionSWARA (Kersuliene et al. 2010); criteria are listed most important first.
topsisfunctionTOPSIS (Hwang & Yoon 1981) with vector normalisation, Euclidean distance.
vikorfunctionVIKOR (Opricovic & Tzeng 2004); v is the weight of group utility.
waspasfunctionWASPAS (Zavadskas et al. 2012): lam * WSM + (1 - lam) * WPM.
WeightingResultclassCriteria weights from a weighting method (ranking is best first).
wispfunctionWISP (Stanujkic et al. 2023): integrated simple weighted sum product method.

bulanik.mcdm.bwm

Full entries: bulanik.mcdm.bwm

NameKindSummary
bwm_consistency_indexfunctionRezaei's (2015) consistency index for a best-over-worst comparison.
fuzzy_bwm_consistency_indexfunctionGuo & Zhao's (2017) consistency index for a fuzzy best-over-worst comparison.
resolve_best_worstfunctionValidate BWM comparison vectors and resolve the best and worst criteria.

bulanik.lumix

Full entries: bulanik.lumix

NameKindSummary
bwm_linearfunctionLinear best-worst method (Rezaei 2016, Omega 64:126-130).
FuzzyGoalclassA fuzzy goal on a linear expression \(z\) (Zimmermann 1978).
ScoreRecordclassOne scored item.
scores_as_datafunctionMCDM scores as records for LXVariable(...).from_data(records).
solve_zimmermannfunctionBuild the Zimmermann model on model and solve it.
zimmermannfunctionAdd Zimmermann's max-min fuzzy goal rows to model and return it.
ZimmermannResultclassOutcome of solve_zimmermann.

bulanik.sezgi

Full entries: bulanik.sezgi

NameKindSummary
ANFISProblemclassTraining RMSE of an ANFIS as a sezgi problem.
ANFISTrainResultclassOutcome of train_anfis.
BWMProblemclassRezaei's (2015, Omega 53:49-57) nonlinear best-worst method.
FuzzyBWMProblemclassGuo & Zhao's (2017, Knowledge-Based Systems 121:23-31) fuzzy best-worst method.
train_anfisfunctionTrain a deep copy of anfis with sezgi; anfis itself is untouched.

bulanik.plot

Full entries: bulanik.plot

NameKindSummary
alpha_cutsfunctionThe \(\alpha\)-cuts of a number as stacked horizontal intervals.
current_themefunctionThe tokens of the active theme, as a read-only mapping.
defuzzificationfunctionA number with markers at the crisp values of its score functions.
dematelfunctionDEMATEL cause-effect diagram: prominence against relation, with the strong influences.
it2_numberfunctionInterval type-2 trapezoidal numbers: upper and lower trapezoids and the footprint between them.
it2_setfunctionFootprint of uncertainty of interval type-2 sets.
iv_orthopairfunctionInterval-valued orthopair numbers as rectangles in the \(\mu\)–\(\nu\) plane.
mamdani_outputfunctionHow a Mamdani system reaches its crisp output for one set of inputs.
membershipfunctionMembership functions of triangular and trapezoidal numbers on one axis.
neutrosophicfunctionNeutrosophic numbers as \(T\)/\(I\)/\(F\) radar triangles.
orthopairfunctionOrthopair numbers as points in the \(\mu\)–\(\nu\) plane with their feasible regions.
PALETTEconstantThe categorical palette: eight hues in a fixed order, one tuple per theme.
picturefunctionPicture fuzzy numbers on the \(\mu\)–\(\eta\)–\(\nu\) ternary simplex.
rankingfunctionAlternatives sorted best first, as a dot plot of their scores.
sphericalfunctionSpherical fuzzy numbers inside the positive octant of the unit sphere.
surfacefunctionInput-output map of a fuzzy system: a 3-D surface (2 inputs) or a curve (1 input).
themefunctionContext manager that applies the house style in a light or dark variant.
variablefunctionEvery term of a linguistic variable or scale, direct-labelled.
weightsfunctionCriteria weights as horizontal bars, largest first, value at each tip.