incremental_learner.fmnn

Simpson fuzzy min-max neural network classifier trained by the incremental learning algorithm.

class hbbrain.numerical_data.incremental_learner.fmnn.FMNNClassifier(theta=0.5, gamma=1, is_draw=False, V=None, W=None, C=None)[source]

Bases: BaseFMNNClassifier

Simpson fuzzy min-max neural network classifier.

This class implements an original incremental learning algorithm to train a fuzzy min-max neural network classifier. The details of this algorithm can be found in [1].

Parameters:
thetafloat, optional, default=0.5

Maximum hyperbox size for numerical features.

gammafloat or ndarray of shape (n_features,), optional, default=1

A sensitivity parameter describing the speed of decreasing of the membership function in each continuous feature.

is_drawboolean, optional, default=False

Whether the construction of hyperboxes can be progressively shown during the training process on a canvas window.

Varray-like of shape (n_hyperboxes, n_features)

A matrix stores all minimal points for numerical features of all existing hyperboxes, in which each row is a minimal point of a hyperbox.

Warray-like of shape (n_hyperboxes, n_features)

A matrix stores all maximal points for numerical features of all existing hyperboxes, in which each row is a minimal point of a hyperbox.

Carray-like of shape (n_hyperboxes,)

A vector stores all class labels correponding to existing hyperboxes.

References

[1]

P. Simpson, “Fuzzy min—max neural networks—Part 1: Classification,” IEEE Transactions on Neural Networks, vol. 3, no. 5, pp. 776-786, 1992.

Examples

>>> from sklearn.datasets import load_iris
>>> from hbbrain.numerical_data.incremental_learner.fmnn import FMNNClassifier
>>> X, y = load_iris(return_X_y=True)
>>> from sklearn.preprocessing import MinMaxScaler
>>> scaler = MinMaxScaler()
>>> scaler.fit(X)
MinMaxScaler()
>>> X = scaler.transform(X)
>>> clf = FMNNClassifier(theta=0.1).fit(X, y)
>>> clf.predict(X[[10, 50, 100]])
array([0, 1, 2])
Attributes:
elapsed_training_timefloat

Training time in seconds.

Methods

delay([delay_constant])

Delay a time period to display hyperboxes

draw_hyperbox_and_boundary([window_name, ...])

Draw the existing hyperboxes and their decision boundaries among classes

fit(X, y)

Fit the fuzzy min-max neural network classifier according to the given training data using the Simpson's original incremental learning algorithm.

get_n_hyperboxes()

Get number of hyperboxes in the trained hyperbox-based model

get_params([deep])

Get parameters for this estimator.

get_sample_explanation(x)

Get useful information for explaining the reason behind the predicted result for the input pattern

initialise_canvas_graph([n_dims, ...])

Initialise a canvas to draw hyperboxes

predict(X)

Predict class labels for samples in X.

predict_proba(X)

Predict class probabilities of the input samples X.

predict_with_membership(X)

Predict class membership values of the input samples X.

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

show_sample_explanation(xl, xu, ...[, ...])

Show explanation for predicted results of an input pattern under the form of parallel coordinates or hyperboxes in 2D or 3D planes.

simple_pruning(X_val, y_val[, ...])

Simply prune low qualitied hyperboxes based on a pre-defined accuracy threshold for each hyperbox

fit(X, y)[source]

Fit the fuzzy min-max neural network classifier according to the given training data using the Simpson’s original incremental learning algorithm.

Parameters:
Xarray-like of shape (n_samples, n_features)

Training vector, where n_samples is the number of samples and n_features is the number of features.

yarray-like of shape (n_samples,)

Target vector relative to X.

Returns:
selfobject

Fitted fuzzy min-max neural network.