dyn2sel.dcs_techniques package¶
Submodules¶
dyn2sel.dcs_techniques.base module¶
dyn2sel.dcs_techniques.desdd_selection module¶
-
class
dyn2sel.dcs_techniques.desdd_selection.DESDDSel(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.base.DCSTechnique-
predict(ensemble, instances, real_labels=None)¶
-
dyn2sel.dcs_techniques.mde_selection module¶
-
class
dyn2sel.dcs_techniques.mde_selection.MDESel(minority_class, n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.base.DCSTechnique-
predict(ensemble, instances, real_labels=None)¶
-
dyn2sel.dcs_techniques.rank module¶
-
class
dyn2sel.dcs_techniques.rank.Rank(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.base.DCSTechniqueDCS-RANK The DCS-RANK method ranks the classifiers by competence and selecting the first position of the rank to predict the instance. The method starts with gathering the neighbors using K-Nearest Neighbors, and these are sorted according to the Euclidean distance to the instance to be predicted. Next, the rank of competence of the classifiers is built, based on the number of consecutive correct predictions each classifier made on the list of neighbors.
Sabourin, M., Mitiche, A., Thomas, D., Nagy, G. 1993. Classifier combination forhand-printed digit recognition. In:Proceedings of 2nd International Conference on Document Analysis and Recognition (ICDAR ’93). [S.l.: s.n.]. p. 163–166.
Module contents¶
-
class
dyn2sel.dcs_techniques.Rank(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.base.DCSTechniqueDCS-RANK The DCS-RANK method ranks the classifiers by competence and selecting the first position of the rank to predict the instance. The method starts with gathering the neighbors using K-Nearest Neighbors, and these are sorted according to the Euclidean distance to the instance to be predicted. Next, the rank of competence of the classifiers is built, based on the number of consecutive correct predictions each classifier made on the list of neighbors.
Sabourin, M., Mitiche, A., Thomas, D., Nagy, G. 1993. Classifier combination forhand-printed digit recognition. In:Proceedings of 2nd International Conference on Document Analysis and Recognition (ICDAR ’93). [S.l.: s.n.]. p. 163–166.
-
class
dyn2sel.dcs_techniques.APosteriori(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceA Posteriori The A Posteriori method gathers the most similar instances in the validation set to the instance to be classified using K-Nearest Neighbors. Then, for each classifier, it sums the probability outputted by the classifier for each neighbor being of the class they really are. The classifier with the highest value for this metric is selected for prediction. Contrary to A Priori, this method only takes into consideration when computing the metric for each classifier the neighbors that belong to the class predicted by the classifier.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
G. Giacinto and F. Roli, Methods for Dynamic Classifier Selection 10th Int. Conf. on Image Anal. and Proc., Venice, Italy (1999), 659-664.
-
class
dyn2sel.dcs_techniques.APriori(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceA Priori The A Priori method provides a selection method based on probabilities. It gathers the most similar instances in the validation set to the instance to be classified using K-Nearest Neighbors. Then, for each classifier, it sums the probability outputted by the calssifier for each neighbor being of the class they really are. The classifier with the highest value for this metric is selected for prediction.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_priori.html>
The implementation used for this method is provided by DESLIB
G. Giacinto and F. Roli, Methods for Dynamic Classifier Selection 10th Int. Conf. on Image Anal. and Proc., Venice, Italy (1999), 659-664.
-
class
dyn2sel.dcs_techniques.KNOP(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceK-Nearest Output Profiles (KNOP, gathers the most similar instances in the validation set using K-Nearest Neighbors using their output profiles on the instance to be predicted. The next step follows KNORA-U, i.e, if the classifier correctly predicts at least one of the neighbors, it is then picked to classify the instance and the more correctly predicted neighbors, the more votes the classifier will have in the final prediction.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Cavalin, Paulo R., Robert Sabourin, and Ching Y. Suen. “LoGID: An adaptive framework combining local and global incremental learning for dynamic selection of ensembles of HMMs.” Pattern Recognition 45.9 (2012): 3544-3556.
-
class
dyn2sel.dcs_techniques.KNORAE(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceKNORA-ELIMINATE
K-Nearest Oracles Eliminate or KNORA-ELIMINATE looks for classifiers in the ensemble that classified all of the K-nearest neighbors correctly. If there is no classifier with such level of accuracy in the neighbors, the classifiers that got (K−1) instances corrected are selected, and subsequently decreasing K until at least one of the classifiers is selected.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/des/knora_e.html>
The implementation used for this method is provided by DESLIB
Ko, Albert HR, Robert Sabourin, and Alceu Souza Britto Jr. “From dynamic classifier selection to dynamic ensemble selection.” Pattern Recognition 41.5 (2008): 1718-1731.
-
class
dyn2sel.dcs_techniques.KNORAU(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceKNORA-UNION
K-Nearest Oracles Union or KNORA-UNION looks for classifiers in the ensemble that classified at least one of the K-nearest neighbors correctly. If there is no classifier with such level of accuracy in the neighbors, the classifiers that got (K−1) instances corrected are selected, and subsequently decreasing K until at least one of the classifiers is selected. The classifiers that predicted more neighbors correctly have more votes on the final combination rule
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/des/knora_u.html>
The implementation used for this method is provided by DESLIB
Ko, Albert HR, Robert Sabourin, and Alceu Souza Britto Jr. “From dynamic classifier selection to dynamic ensemble selection.” Pattern Recognition 41.5 (2008): 1718-1731.
-
class
dyn2sel.dcs_techniques.LCA(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceOLA The Overall Local Accuracy (OLA) first gathers the K-Nearest neighbors of the query instance. Next, the algorithm computes the accuracy of each classifier regarding only the neighbors returned. It then proceeds to pick the most accurate classifier to predict the instance.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Woods, Kevin, W. Philip Kegelmeyer, and Kevin Bowyer. “Combination of multiple classifiers using local accuracy estimates.” IEEE transactions on pattern analysis and machine intelligence 19.4 (1997): 405-410.
-
class
dyn2sel.dcs_techniques.OLA(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceThe Overall Local Accuracy (OLA) first gathers the K-Nearest neighbors of the query instance. Next, the algorithm computes the accuracy of each classifier regarding only the neighbors returned. It then proceeds to pick the most accurate classifier to predict the instance.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Woods, Kevin, W. Philip Kegelmeyer, and Kevin Bowyer. “Combination of multiple classifiers using local accuracy estimates.” IEEE transactions on pattern analysis and machine intelligence 19.4 (1997): 405-410.
-
class
dyn2sel.dcs_techniques.MCB(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceLCA The Local Class Accuracy (LCA) first gathers the K-Nearest neighbors of the query instance that are from the class predicted by each classifier. Next, the algorithm computes the accuracy of each classifier regarding only the neighbors returned. It then proceeds to pick the most accurate classifier to predict the instance.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Woods, Kevin, W. Philip Kegelmeyer, and Kevin Bowyer. “Combination of multiple classifiers using local accuracy estimates.” IEEE transactions on pattern analysis and machine intelligence 19.4 (1997): 405-410.
-
class
dyn2sel.dcs_techniques.METADES(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceThe META-DES technique is a different approach to the classifier selection problem. The previous method focused on single features of the relationship between each classifier and the test instances, for example, Local Accuracy. META-DES, instead, takes into consideration multiple features. And instead of trying to design a selection method, it considers this task another classification problem, thus delegating it to a meta-classifier.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Cruz, R.M., Sabourin, R., Cavalcanti, G.D. and Ren, T.I., 2015. META-DES: A dynamic ensemble selection framework using meta-learning. Pattern Recognition, 48(5), pp.1925-1935.
-
class
dyn2sel.dcs_techniques.ModifiedRank(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.from_deslib.deslib_interface.DESLIBInterfaceModified Rank Proposed modified version of DCS-RANK. When an instance arrives to be predicted, for each classifier, the nearest instances that belong to the class that was predicted by the classifier are returned. Finally, the neighbors of that class are sorted according to the Euclidean distance to the instance to be predicted. Next, the rank of competence of the classifiers is built, based on the number of consecutive correct predictions each classifier made on the list of neighbors.
- **kwargs
- Defined here <https://deslib.readthedocs.io/en/latest/modules/dcs/a_posteriori.html>
The implementation used for this method is provided by DESLIB
Woods, Kevin, W. Philip Kegelmeyer, and Kevin Bowyer. “Combination of multiple classifiers using local accuracy estimates.” IEEE transactions on pattern analysis and machine intelligence 19.4 (1997): 405-410.
-
class
dyn2sel.dcs_techniques.Oracle(n_neighbors=7, algorithm='auto')¶ Bases:
dyn2sel.dcs_techniques.base.DCSTechniqueThe idea is to select one of the classifiers of the ensemble (if it exists) that correctly predicted the instance. This is obviously not suitable for real problems since it depends on having the class of the instances to predict. The sole purpose of this method is to check if there is room available for increasing the performance of the ensemble. In other words, if the Oracle considerably outperforms a normal execution, it means that there are classifiers that are predicting correctly when the majority is predicting wrongly, thus it is expected that a good selection method will bring benefits. References ———-
Britto, A. S.; Sabourin, R.; Oliveira, L. E. 2014. Dynamic selection of classifiers — a comprehensive review. Pattern Recognition, v. 47, n. 11, p. 3665 – 3680, 2014. ISSN 0031-3203. Available in: <http://www.sciencedirect.com/science/article/pii/S0031320314001885>.-
predict(ensemble, instances, real_labels=None)¶
-