API Documentation¶
-
class
vfi.
VFI
(n_bins='auto', strategy='uniform')¶ Classification by voting feature intervals.
Intervals are constucted around each class for each attribute (basically discretization). Class counts are recorded for each interval on each attribute. Classification is by voting.
- Parameters
- n_binsint (default=”auto”)
The number of bins to produce. When is set to ‘auto’ the n_bins equals to the double of the number of classes. Raises ValueError if n_bins < 2.
- strategy{‘uniform’, ‘quantile’, ‘kmeans’}, (default=’quantile’)
Strategy used to define the widths of the bins.
- uniform
All bins in each feature have identical widths.
- quantile
All bins in each feature have the same number of points.
- kmeans
Values in each bin have the same nearest center of a 1D k-means cluster.
References
- Ra8705851e4ae-1
G. Demiroz, A. Guvenir: Classification by voting feature intervals. In: 9th European Conference on Machine Learning, 85-92, 1997.01.
- Attributes
- classes_array, shape (n_classes,)
The classes.
- classes_distribution_array, shape (n_classes,)
The distribution of the classes.
- interval_class_counts_array, shape (n_features, n_bins, n_classes,)
Contains the raw class counts per feature and per bin.
- n_bins_int
The number of bins used during fit.
- n_classes_int
The number of classes.
Methods
fit
(self, X, y)Fit VFI according to X, y.
get_params
(self[, deep])Get parameters for this estimator.
predict
(self, X)Perform classification on an array of test vectors X.
predict_proba
(self, X)Return probability estimates for the test vector X.
score
(self, X, y[, sample_weight])Return the mean accuracy on the given test data and labels.
set_params
(self, \*\*params)Set the parameters of this estimator.
-
fit
(self, X, y)¶ Fit VFI according to X, y.
- Parameters
- Xarray-like, shape (n_samples, n_features)
The training input samples.
- yarray-like, shape (n_samples,)
The target values. An array of int.
- Returns
- selfobject
Returns self.
-
predict
(self, X)¶ Perform classification on an array of test vectors X.
- Parameters
- Xarray-like, shape (n_samples, n_features)
The input samples.
- Returns
- yndarray, shape (n_samples,)
Predicted target values for X.
-
predict_proba
(self, X)¶ Return probability estimates for the test vector X.
- Parameters
- Xarray-like of shape (n_samples, n_features)
- Returns
- probasarray-like of shape (n_samples, n_classes)
Returns the probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear in the attribute classes_.