fuzzyclust.models#

Clustering for model identification.

Fuzzy clusters in the product space of inputs and outputs are local models: each cluster becomes a rule whose antecedent is the projection of the cluster onto the inputs and whose consequent is the local linear model hidden in the cluster. This sub-package collects the algorithms that exploit this view:

  • ModifiedGG – modified Gath–Geva clustering with axis-parallel Gaussian antecedents and local linear (SISO or MIMO) consequents; the clustering engine behind the Takagi–Sugeno model;

  • TakagiSugeno – the user-facing regressor: Takagi–Sugeno model identified by ModifiedGG or by Gustafson–Kessel clustering in the product space with projected antecedents;

  • FuzzyCRegression – fuzzy c-regression models (switching regression, Hathaway & Bezdek 1993), clusters are hyperplanes;

  • SupervisedFuzzyClassifier – supervised fuzzy clustering whose rules carry class-probability consequents (Abonyi & Szeifert 2003);

  • supervised_fuzzy_partition(), FuzzyPartitionDiscretizer – per-feature fuzzy partitions derived from supervised clustering, for decision-tree induction (Abonyi 2010);

  • HingingHyperplaneTree – binary regression tree with hinging hyperplane nodes identified by fuzzy c-regression (Kenesei & Abonyi 2013);

  • select_features_by_separability() – Fisher interclass-separability based backward feature elimination of the fuzzy classifier;

  • simulate_free_run() – free-run simulation of NARX models built with fuzzyclust.preprocessing.make_regressors();

  • data generators make_* and plot helpers plot_*.

Takagi–Sugeno identification by modified Gath–Geva clustering, fuzzy c-regression, supervised fuzzy classifiers, fuzzy partitions for trees, hinging-hyperplane trees.

Classes#

ModifiedGG([n_clusters, m, ...])

Modified Gath–Geva clustering: clusters are interpretable Takagi–Sugeno rules.

TakagiSugeno([n_clusters, m, antecedent, ...])

Takagi–Sugeno (TS) fuzzy model with rules extracted from fuzzy clusters.

FuzzyCRegression([n_clusters, m, ...])

Fuzzy c-regression models (FCRM): clusters are regression hyperplanes.

SupervisedFuzzyClassifier([n_clusters, m, ...])

Fuzzy rule-based classifier identified by supervised Gath–Geva type clustering.

FuzzyPartitionDiscretizer([n_sets, shape, ...])

Supervised fuzzy discretization of continuous features.

HingingHyperplaneTree([max_depth, ...])

Binary regression tree with hinging-hyperplane nodes identified by fuzzy c-regression.

HingeNode(theta, kind, depth, n_samples, ...)

One node of a HingingHyperplaneTree.

Functions#

simulate_free_run(model, u, y_init, n_a[, ...])

Free-run (parallel) simulation of a NARX model.

weighted_least_squares(Xe, Y, w)

Weighted least-squares estimate of local model parameters.

select_features_by_separability(X, y[, ...])

Backward feature elimination by the Fisher interclass separability of the rules.

supervised_fuzzy_partition(X, y[, ...])

Per-feature fuzzy partitions derived from supervised fuzzy clustering.

ruspini_partition(X[, n_sets])

Ruspini-type (equidistant triangular) partition of every feature, the unsupervised baseline.

membership_1d(x, centers, sigmas[, shape])

Evaluate the fuzzy sets of one feature at the values x.

set_similarity(A, B)

Jaccard-type similarity \(S=|A\cap B|/|A\cup B|\) of two fuzzy sets sampled on a common grid.

plot_membership_functions(model[, X, ...])

Gaussian antecedent membership functions \(A_{ij}(x_j)\) of every rule, one panel per input.

plot_local_models(model, X, y[, ax, ...])

One-input Takagi–Sugeno model: data, local linear models, model output and firing strengths.

plot_fuzzy_partition(discretizer, feature[, ...])

Fuzzy sets of one feature of a fitted FuzzyPartitionDiscretizer.

plot_hinge_tree_surface(tree, X[, y, ax, ...])

Prediction surface (filled contours) of a two-input hinging-hyperplane tree with its hinges.

plot_decision_regions(clf, X[, y, ax, ...])

Decision regions of a two-input classifier, optionally with the rule centers and antecedent ellipses.

make_sinc([n_samples, noise, n_features, ...])

Samples of the sinc function, the classic static benchmark of fuzzy modeling.

make_piecewise_linear([n_samples, noise, ...])

A continuous piecewise-linear function of two variables (sum of two hinges).

piecewise_linear_function(X)

Noise-free value of the function behind make_piecewise_linear().

make_switching_lines([n_samples, slopes, ...])

Switching regression data: samples of several lines over a common input range.

make_second_order_plant([n_samples, ...])

The second-order nonlinear benchmark plant of Abonyi, Babuška and Szeifert (2002).

second_order_plant_function(y1, y2)

Nonlinear component \(f(y(k-1), y(k-2))\) of make_second_order_plant().

make_mimo_plant([n_samples, hold, noise, ...])

A two-input two-output nonlinear process with operating-point-dependent gains.

make_two_class_overlap([n_samples, spread, ...])

Two overlapping classes, each a mixture of two Gaussian blobs (XOR layout).

make_banded_classes([n_samples, random_state])

Three classes separated by thresholds on two features, plus one irrelevant feature.