scikit-learn-contrib / DESlib

A Python library for dynamic classifier and ensemble selection
BSD 3-Clause "New" or "Revised" License
481 stars 106 forks source link

How to get the estimate_competence #263

Closed ItsHaiming closed 2 years ago

ItsHaiming commented 2 years ago

Hi I'm using KNORA-U to do the classification problem. I hope to get the final classifier chosen from the classifier pool, and I can see from the document that there are functions like "estimate_competence(competence_region, distances=None, predictions=None)" and "select(competences)" to achieve this. But I'm confused about the parameter" competence_region", is there any example or explanation for this?

Many thanks!

ItsHaiming commented 2 years ago

Is that mean, I should create an array, with the index of k nearest neighbors? should I use KNN to find the parameter?

Menelau commented 2 years ago

Hello,

Yes, the competence region is the array with the K-nearest neighbours for all testing instances. you can obtain this array calling the _get_region_competence function in the library.