randomfuzzyrules:-random-search-delivers-fast,-interpretable-two-rule-fuzzy-classifiers
RandomFuzzyRules: Random Search Delivers Fast, Interpretable Two-Rule Fuzzy Classifiers

RandomFuzzyRules: Random Search Delivers Fast, Interpretable Two-Rule Fuzzy Classifiers

Machine learning models that can explain themselves are increasingly in demand, but the search for compact, human-readable rule bases has often been slow. A new software package called RandomFuzzyRules (RFR) challenges the assumption that structured, population-based optimization is needed to find good fuzzy classifiers. Instead of evolving a population of candidate rule sets, RFR simply samples thousands of them at random, keeps the best, and does so dramatically faster than the gene-expression-programming approach it was designed to replace, while matching its predictive quality across a large benchmark of binary classification tasks.

The work builds on a long line of research arguing that fuzzy rule bases need no elaborate membership functions. Fuzzy rules state a decision as a short list of linguistic conditions and allow graded rather than crisp membership, which makes the model structure itself the explanation rather than a post-hoc rationalization of a black box. Earlier studies, including clinical applications that classified peri-operative complications, showed that Takagi–Sugeno systems with linear membership functions can yield interpretable classifiers. A later refinement searched this restricted space with gene expression programming (GEP), producing the Extremely Simple Classifier, released as the GPR package and reported among the most concise fuzzy rule generators in a medical benchmark.

What RFR changes is the search procedure rather than the model class. The authors replace GPR’s population-based GEP search with independent random sampling of candidate fuzzy rule sets. This draws on a broader pattern in machine learning: random hyper-parameter sampling can outperform grid search when only a subset of parameters materially affects performance, Extreme Learning Machines randomize hidden-layer weights, and ROCKET uses random convolutional kernels for time-series classification. RFR applies the same principle to a restricted space of fuzzy rule sets, with candidate evaluation accelerated by Numba-compiled kernels that avoid any separate C/C++ toolchain.

The classifier follows the scikit-learn estimator interface, providing fit, decision_function, predict_proba, and predict methods. Each rule’s antecedent is a conjunction of conditions of the form “feature is a linguistic term.” Continuous features are scaled to the interval [0,1], and conditions use membership functions of the form x^q or (1−x)^q. With the maximum exponent Q set to 1, membership is linear and Ruspini’s condition holds, so the two membership degrees sum to one; exponents of 2 and 3 implement the linguistic hedges “very” and “extremely.” Categorical features are one-hot encoded, with membership given directly by the encoded column or its complement.

Inference proceeds by summing, over all rules, the products of the membership degrees of each rule’s conditions, producing a score s(x). The probability-like output applies a heuristic mapping that preserves the score ordering but is not a calibrated posterior; the mapping was chosen so that a probability of 0.5 coincides with the default score threshold of GPR. Calibrated probabilities can be obtained post hoc with scikit-learn’s CalibratedClassifierCV using Platt scaling or isotonic regression. During training, candidates are sampled independently, converted to a canonical representation, and rejected if structurally invalid or duplicates. By default, candidates are ranked by training accuracy, which induces exactly the same ordering as GPR’s published fitness function, since that fitness is a strictly increasing affine function of accuracy. Ties are broken lexicographically in favor of fewer conditions, fewer rules, and smaller literal repetition orders.

The search space is larger than it might first appear. With p transformed continuous features, at most two conditions per rule, and high and low states, the number of admissible individual rules is 2p², and the number of rule sets containing one or two distinct unordered rules grows quadratically from that. When the number of features rises from 10 to 1000, the number of admissible rule sets grows from 20,100 to approximately 2×10¹². A target of 1,000 unique candidates therefore covers between roughly 5×10⁻² and 5×10⁻¹⁰ of the space, depending on dataset size — a striking illustration that random sampling can find useful models in vast combinatorial spaces.

The evaluation used 73 binary-classification datasets available through BeyondArena’s Data Foundry with predefined splits. Eight datasets were excluded: five could not be downloaded, two represented text through language-model embedding dimensions that would produce rules without meaningful feature-level interpretations, and one caused the FIGS classifier to stall during a single split. Of the remaining 65 datasets, 25 formed a development partition for ablation and configuration validation, while 40 formed a held-out partition for the final comparison against GPR, a majority-class dummy baseline, FIGS, HSTree, and GreedyRuleList from the imodels package. Metrics included accuracy, balanced accuracy, the Matthews correlation coefficient (MCC), and AUROC, with statistical comparisons via pairwise Wilcoxon signed-rank tests with Holm correction at α = 0.05. Experiments ran on Ubuntu 24.04 with an AMD EPYC 9354 processor, locked environments, and fixed random seeds.

An ablation study guided the choice of RFR’s defaults: at most two rules, at most two conditions per rule, linear membership only, and a budget of 1,000 candidates. On the 25 development datasets, this compact configuration achieved a mean accuracy of 0.8165 versus 0.8168 for the larger reference configuration, with balanced accuracy and AUROC nearly unchanged, though MCC decreased slightly from 0.2586 to 0.2399 — a reminder that simplification is not neutral across all performance measures. On the 40 held-out datasets, RFR and GPR were statistically indistinguishable in accuracy, balanced accuracy, and MCC, with win/tie/loss counts of 20/1/19, 20/1/19, and 21/1/18 respectively. The authors caution that the lack of statistical separation indicates no consistent difference was detected, not formal equivalence between the classifiers.

Training time told a clearer story. With the default, deliberately unequal budgets, RFR was faster than an accelerated GPR implementation on every one of the 40 held-out datasets, with a mean fitting time of 0.2648 seconds versus 2.5711 seconds for GPR, and a median of just 0.0135 seconds against 1.1521 seconds. RFR also produced smaller models in practice, with a median of one rule and two conditions, compared with GPR’s median of two rules and 4.35 conditions. A separate single-thread scalability study on synthetic data showed that training time increased with the number of observations for every classifier, with RFR and GreedyRuleList remaining faster than GPR and FIGS throughout the tested range, while RFR and GPR changed only moderately as dimensionality grew.

The authors are careful about the limits of their claims. RFR’s higher AUROC over GPR reflects the continuous scores its interface exposes, whereas GPR outputs hard class predictions, for which AUROC mathematically equals balanced accuracy; the advantage should therefore not be read as evidence of fundamentally greater discrimination. Both fuzzy classifiers also trailed FIGS and HSTree in balanced accuracy, AUROC, and MCC, and RFR fell to or below the majority baseline’s balanced accuracy of 0.5 on 13 of the 40 datasets, consistent with the accuracy objective favoring near-majority predictions under class imbalance — a problem users can address by supplying balanced accuracy or MCC as a custom objective. The package, released under the MIT license with locked environments, resumable reproduction scripts for Linux and Windows, and reference results, offers a reproducible alternative to the legacy GPR stack, with future work planned on matched search budgets, calibrated outputs, and export to the IEEE 1855-2016 Fuzzy Markup Language.

Subject of Research: Randomized induction of interpretable fuzzy rule-based classifiers for binary tabular classification

Article Title: RandomFuzzyRules: fast randomized induction of two-rule interpretable fuzzy classifiers

Article References: Żyła, R., & Kluska, J. (2026). RandomFuzzyRules: fast randomized induction of two-rule interpretable fuzzy classifiers. SoftwareX, 36, Article 103169. https://doi.org/10.1016/j.softx.2026.103169

Image Credits: AI Generated

DOI: 10.1016/j.softx.2026.103169

Keywords: fuzzy classifiers, interpretable machine learning, random search, rule-based classification, scikit-learn, gene expression programming, Numba, benchmark evaluation, binary classification, reproducibility, tabular data, open-source software