Takes the given utility measure and selector functions and makes a query strategy by combining them. Args: utility_measure: Utility measure, for instance :func:`~modAL.disagreement.vote_entropy`, but it can be a custom function as well. Should take a classifier and the
(utility_measure: Callable, selector: Callable)
| 62 | |
| 63 | |
| 64 | def make_query_strategy(utility_measure: Callable, selector: Callable) -> Callable: |
| 65 | """ |
| 66 | Takes the given utility measure and selector functions and makes a query strategy by combining them. |
| 67 | |
| 68 | Args: |
| 69 | utility_measure: Utility measure, for instance :func:`~modAL.disagreement.vote_entropy`, but it can be a custom |
| 70 | function as well. Should take a classifier and the unlabelled data and should return an array containing the |
| 71 | utility scores. |
| 72 | selector: Function selecting instances for query. Should take an array of utility scores and should return an |
| 73 | array containing the queried items. |
| 74 | |
| 75 | Returns: |
| 76 | A function which returns queried instances given a classifier and an unlabelled pool. |
| 77 | """ |
| 78 | def query_strategy(classifier: BaseEstimator, X: modALinput) -> Tuple: |
| 79 | utility = utility_measure(classifier, X) |
| 80 | return selector(utility) |
| 81 | |
| 82 | return query_strategy |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…