alpbench.pipeline.QueryStrategy¶
Classes
|
This class is an abstract class for active learning query strategies that are ensemble-based. |
|
This class is an abstract class for active learning query strategies that are model-based. |
|
This class is an abstract class for active learning query strategies. |
|
This class is used to sample instances from the pool of unlabeled instances based on the BALD method. |
|
This class is used to sample instances from the pool of unlabeled instances based on the BatchBALD method. |
ClusterMargin |
|
|
This class is used to sample instances from the pool of unlabeled instances based on the core set method. |
This class is an abstract class for query strategies that are based on embeddings. |
|
|
|
|
This class is used to sample instances from the pool of unlabeled instances based on entropy. |
This class is used to sample instances from the pool of unlabeled instances based on epistemic uncertainty. |
|
|
This class is used to sample instances from the pool of unlabeled instances based on the expected average precision. |
|
This class is used to sample instances from the pool of unlabeled instances based on the FALCUN method. |
|
This class is used to sample instances from the pool of unlabeled instances based on the KMeans method. |
This class is used to sample instances from the pool of unlabeled instances based on least confidence. |
|
|
This class is used to sample instances from the pool of unlabeled instances based on the margin method. |
|
This class is used to sample instances from the pool of unlabeled instances based on the maximum entropy method. |
|
This class is used to sample instances from the pool of unlabeled instances based on the minimum margin method. |
|
This class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method with the log loss method. |
This class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method with the misclassification loss method. |
|
|
This class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method. |
|
This class is used to sample instances from the pool of unlabeled instances based on a power version of BALD. |
|
This class is used to sample instances from the pool of unlabeled instances based on the power margin method. |
This class is an abstract class for query strategies that are pseudo-randomized, meaning that they can be reproduced with the same random seed. |
|
|
This class is used to sample instances from the pool of unlabeled instances based on QBC method with variance ratio as measure of ensemble disagreement. |
|
This class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method with entropy as measure of ensemble disagreement. |
|
This class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method with KL-divergence as measure of ensemble disagreement. |
|
This class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method. |
This class is an abstract class for query strategies. |
|
This class is used to sample instances from the pool of unlabeled instances based on the random margin method. |
|
|
This class is used to sample instances from the pool of unlabeled instances randomly. |
This class is used to sample instances from the pool of unlabeled instances based on the typicality of the instances in the clusters. |
|
|
This class is used to sample instances from the pool of unlabeled instances based on uncertainty. |
This class is used to sample instances from the pool of unlabeled instances based on the weighted cluster method. |
|
|
This class is used to wrap a query strategy with a learner. |
- class alpbench.pipeline.QueryStrategy.ActiveMLEnsembleQueryStrategy(seed, qs, ensemble_size)[source]¶
Bases:
ActiveMLQueryStrategyThis class is an abstract class for active learning query strategies that are ensemble-based. The query strategies are used to sample instances from the pool of unlabeled instances.
- Parameters:
- qs¶
object
- class alpbench.pipeline.QueryStrategy.ActiveMLModelBasedQueryStrategy(seed, qs)[source]¶
Bases:
ActiveMLQueryStrategyThis class is an abstract class for active learning query strategies that are model-based. The query strategies are used to sample instances from the pool of unlabeled instances.
- Parameters:
seed (int) – The seed for the random number generator.
qs – object
- qs¶
object
- class alpbench.pipeline.QueryStrategy.ActiveMLQueryStrategy(seed, qs)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is an abstract class for active learning query strategies. The query strategies are used to sample instances from the pool of unlabeled instances.
- Parameters:
seed (int) – The seed for the random number generator.
qs – object
- qs¶
object
- class alpbench.pipeline.QueryStrategy.BALDQueryStrategy(seed, ensemble_size)[source]¶
Bases:
EnsemblePseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the BALD method.
- Parameters:
- class alpbench.pipeline.QueryStrategy.BatchBaldQueryStrategy(seed, ensemble_size)[source]¶
Bases:
ActiveMLEnsembleQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the BatchBALD method.
- Parameters:
- class alpbench.pipeline.QueryStrategy.ClusterMarginQueryStrategy(seed)[source]¶
Bases:
EmbeddingBasedQueryStrategyClusterMargin
This class is used to sample instances from the pool of unlabeled instances based on the cluster margin method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.CoreSetQueryStrategy(seed)[source]¶
Bases:
EmbeddingBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the core set method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.DiscriminativeQueryStrategy(seed)[source]¶
Bases:
ActiveMLQueryStrategy
- class alpbench.pipeline.QueryStrategy.EmbeddingBasedQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is an abstract class for query strategies that are based on embeddings. The query strategies are used to sample instances from the pool of unlabeled instances.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.EnsemblePseudoRandomizedQueryStrategy(seed, ensemble_size)[source]¶
- class alpbench.pipeline.QueryStrategy.EntropyQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on entropy.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.EpistemicUncertaintyQueryStrategy(seed)[source]¶
Bases:
ActiveMLModelBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on epistemic uncertainty.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.ExpectedAveragePrecision(seed)[source]¶
Bases:
UncertaintyQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the expected average precision.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.FalcunQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the FALCUN method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.KMeansQueryStrategy(seed)[source]¶
Bases:
EmbeddingBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the KMeans method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.LeastConfidentQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on least confidence.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.MarginQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the margin method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.MaxEntropyQueryStrategy(seed, ensemble_size)[source]¶
Bases:
EnsemblePseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the maximum entropy method.
- Parameters:
- class alpbench.pipeline.QueryStrategy.MinMarginQueryStrategy(seed, ensemble_size)[source]¶
Bases:
EnsemblePseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the minimum margin method.
- Parameters:
- class alpbench.pipeline.QueryStrategy.MonteCarloEERLogLoss(seed)[source]¶
Bases:
MonteCarloEERStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method with the log loss method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.MonteCarloEERMisclassification(seed)[source]¶
Bases:
MonteCarloEERStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method with the misclassification loss method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.MonteCarloEERStrategy(seed, method)[source]¶
Bases:
ActiveMLModelBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Monte Carlo EER method.
- Parameters:
- qs¶
object
- class alpbench.pipeline.QueryStrategy.PowerBALDQueryStrategy(seed, ensemble_size)[source]¶
Bases:
EnsemblePseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on a power version of BALD.
- Parameters:
- class alpbench.pipeline.QueryStrategy.PowerMarginQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the power margin method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.PseudoRandomizedQueryStrategy(seed)[source]¶
Bases:
QueryStrategyThis class is an abstract class for query strategies that are pseudo-randomized, meaning that they can be reproduced with the same random seed.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.QBCVarianceRatioQueryStrategy(seed, ensemble_size)[source]¶
Bases:
EnsemblePseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on QBC method with variance ratio as measure of ensemble disagreement.
- Parameters:
- class alpbench.pipeline.QueryStrategy.QueryByCommitteeEntropyQueryStrategy(seed, ensemble_size)[source]¶
Bases:
QueryByCommitteeQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method with entropy as measure of ensemble disagreement.
- Parameters:
- class alpbench.pipeline.QueryStrategy.QueryByCommitteeKLQueryStrategy(seed, ensemble_size)[source]¶
Bases:
QueryByCommitteeQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method with KL-divergence as measure of ensemble disagreement.
- Parameters:
- class alpbench.pipeline.QueryStrategy.QueryByCommitteeQueryStrategy(seed, method, ensemble_size)[source]¶
Bases:
ActiveMLEnsembleQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the Query by Committee method.
- Parameters:
- qs¶
object
- class alpbench.pipeline.QueryStrategy.QueryStrategy[source]¶
Bases:
ABCThis class is an abstract class for query strategies. The query strategies are used to sample instances from the pool of unlabeled instances.
- abstract sample(learner, X_l, y_l, X_u, num_queries)[source]¶
This method samples instances from the pool of unlabeled instances. It is given a learner, that is already fitted on the labeled data and potentially used to predict probabilities for the unlabeled data.
- Parameters:
learner – object
X_l – np.ndarray
y_l – np.ndarray
X_u – np.ndarray
num_queries – int
- class alpbench.pipeline.QueryStrategy.RandomMarginQueryStrategy(seed)[source]¶
Bases:
PseudoRandomizedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the random margin method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.RandomQueryStrategy(seed)[source]¶
Bases:
ActiveMLQueryStrategyThis class is used to sample instances from the pool of unlabeled instances randomly.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.TypicalClusterQueryStrategy(seed)[source]¶
Bases:
EmbeddingBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the typicality of the instances in the clusters.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.UncertaintyQueryStrategy(seed, method)[source]¶
Bases:
ActiveMLQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on uncertainty.
- Parameters:
- qs¶
object
- class alpbench.pipeline.QueryStrategy.WeightedClusterQueryStrategy(seed)[source]¶
Bases:
EmbeddingBasedQueryStrategyThis class is used to sample instances from the pool of unlabeled instances based on the weighted cluster method.
- Parameters:
seed (int) – The seed for the random number generator.
- class alpbench.pipeline.QueryStrategy.WrappedQueryStrategy(wrapped_query_strategy, learner)[source]¶
Bases:
QueryStrategyThis class is used to wrap a query strategy with a learner. The wrapped query strategy is used to sample instances from the pool of unlabeled instances.
- Parameters:
wrapped_query_strategy (
QueryStrategy) – objectlearner – object
- wrapped_query_strategy¶
object
- learner¶
object