incremental_learner.efmnn
Fuzzy min-max neural network classifier trained by the enhanced incremental learning algorithm (EFMNN).
- class hbbrain.numerical_data.incremental_learner.efmnn.EFMNNClassifier(theta=0.5, gamma=1, is_draw=False, V=None, W=None, C=None)[source]
Bases:
BaseFMNNClassifier
Enhanced fuzzy min-max neural network classifier.
This class implements an enhanced learning algorithm for Simpson’s fuzzy min-max neural network. This algorithm use nine test cases for hyperbox overlap test and hyperbox contraction instead of four test cases in the original Simpson’s fuzzy min-max neural network (FMNN). Additionally, this algorithm use the same hyperbox expansion condition regarding the maximum hyperbox size as the general fuzzy min-max neural network. 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]M. Mohammed and C. P. Lim, “An enhanced fuzzy min-max neural network for pattern classification,” IEEE Transactions on Neural Networks and Learning Systems, vol. 26, no. 3, pp. 417-429, 2014.
Examples
>>> from sklearn.datasets import load_iris >>> from hbbrain.numerical_data.incremental_learner.efmnn import EFMNNClassifier >>> X, y = load_iris(return_X_y=True) >>> from sklearn.preprocessing import MinMaxScaler >>> scaler = MinMaxScaler() >>> scaler.fit(X) MinMaxScaler() >>> X = scaler.transform(X) >>> clf = EFMNNClassifier(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 according to the given training data using the enhanced 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 according to the given training data using the enhanced 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.