niaclass
¶
- class niaclass.NiaClass(pop_size=90, num_evals=5000, score_func_name='accuracy', algo='FireflyAlgorithm', **kwargs)
Bases:
object
Implementation of NiaClass classifier.
- Date:
2021
- Author:
Luka Pečnik
- Reference:
The implementation is based on the following article: Iztok Fister Jr., Iztok Fister, Dušan Fister, Grega Vrbančič, Vili Podgorelec. On the potential of the nature-inspired algorithms for pure binary classification. In. Computational science - ICCS 2020 : 20th International Conference, Proceedings. Part V. Cham: Springer, pp. 18-28. Lecture notes in computer science, 12141, 2020
- License:
MIT
- Attributes:
__pop_size (int): Number of individuals in the fitting process. __num_evals (int): Maximum evaluations in the fitting process. __score_func_name (Optional(str)): Used score function. __algo (str): Name of the optimization algorithm to use. __rules (Dict[any, Iterable[_Rule]]): Best set of rules found in the optimization process.
- fit(x, y)
Fit NiaClass.
- Arguments:
x (pandas.core.frame.DataFrame): n samples to classify. y (pandas.core.series.Series): n classes of the samples in the x array.
- Returns:
None
- predict(x)
Predict class for each sample (row) in x.
- Arguments:
x (pandas.core.frame.DataFrame): n samples to classify.
- Returns:
Iterable[any]: n predicted classes.