API Reference#

This is an overview of the API.

skactiveml.base#

The skactiveml.base package implements the base classes for skactiveml.

Classes#

base.QueryStrategy

Base class for all query strategies in scikit-activeml.

base.SingleAnnotatorPoolQueryStrategy

Base class for all pool-based active learning query strategies with a single annotator in scikit-activeml.

base.MultiAnnotatorPoolQueryStrategy

Base class for all pool-based active learning query strategies with multiple annotators in scikit-activeml.

base.BudgetManager

Base class for all budget managers for stream-based active learning to model budgeting constraints.

base.SingleAnnotatorStreamQueryStrategy

Base class for all stream-based active learning query strategies.

base.SkactivemlClassifier

Skactiveml Classifier

base.ClassFrequencyEstimator

Class Frequency Estimator

base.AnnotatorModelMixin

Annotator Model

base.SkactivemlRegressor

Skactiveml Regressor

base.ProbabilisticRegressor

Base class for scikit-activeml probabilistic regressors.

skactiveml.pool#

The skactiveml.pool package implements query strategies for pool-based active learning.

Classes#

pool.RandomSampling

Random Sampling (RS)

pool.ProbabilisticAL

Multi-class Probabilistic Active Learning (McPAL)

pool.UncertaintySampling

Uncertainty Sampling (US)

pool.EpistemicUncertaintySampling

Epistemic Uncertainty Sampling (EpisUS)

pool.MonteCarloEER

Monte Carlo Expected Error Reduction

pool.ValueOfInformationEER

Value of Information (VOI)

pool.QueryByCommittee

Query-by-Committee (QBC)

pool.Quire

QUerying Informative and Representative Examples (QUIRE)

pool.FourDs

4DS

pool.CostEmbeddingAL

Active Learning with Cost Embedding (ALCE)

pool.ExpectedModelChangeMaximization

Expected Model Change (EMC)

pool.ExpectedModelOutputChange

Regression based Expected Model Output Change (EMOC)

pool.ExpectedModelVarianceReduction

Expected Model Variance Reduction (EMVR)

pool.KLDivergenceMaximization

Regression based Kullback-Leibler Divergence Maximization

pool.GreedySamplingX

Greedy Sampling in the Feature Space (GSx)

pool.GreedySamplingTarget

Greedy Sampling in the Target Space (GSi or GSy)

pool.DiscriminativeAL

Discriminative Active Learning (DAL)

pool.BatchBALD

Batch Bayesian Active Learning by Disagreement (BatchBALD)

pool.Clue

Clustering Uncertainty-weighted Embeddings (CLUE)

pool.DropQuery

Dropout Query (DropQuery)

pool.CoreSet

Core Set

pool.TypiClust

Typical Clustering (TypiClust)

pool.Badge

Batch Active Learning by Diverse Gradient Embedding (BADGE)

pool.ProbCover

Probability Coverage (ProbCover)

pool.ContrastiveAL

Contrastive Active Learning (ContrastiveAL)

pool.GreedyBALD

Greedy Bayesian Active Learning by Disagreement (GreedyBALD)

pool.RegressionTreeBasedAL

Regression Tree-based Active Learning (RT-AL)

pool.SubSamplingWrapper

Sub-sampling Wrapper

pool.ParallelUtilityEstimationWrapper

Parallel Utility Estimation Wrapper

pool.Falcun

Fast Active Learning by Contrastive UNcertainty (FALCUN)

Functions#

pool.cost_reduction

Calculate the expected cost reduction.

pool.uncertainty_scores

Computes uncertainty scores.

pool.expected_average_precision

Calculate the expected average precision [R24358fbc63f7-1].

pool.average_kl_divergence

Calculates the average Kullback-Leibler (KL) divergence for measuring the level of disagreement in QueryByCommittee.

pool.vote_entropy

Calculates the vote entropy for measuring the level of disagreement in QueryByCommittee.

pool.variation_ratios

Calculates the variation ratios for measuring the level of disagreement in QueryByCommittee.

pool.batch_bald

BatchBALD: Efficient and Diverse Batch Acquisition for Deep Bayesian Active Learning

pool.k_greedy_center

An active learning method that greedily forms a batch to minimize the maximum distance to a cluster center among all unlabeled datapoints.

skactiveml.pool.multiannotator#

The skactiveml.pool.multiannotator package implements multi annotator pool-based active learning for multiple annotators.

Classes#

pool.multiannotator.IntervalEstimationThreshold

Interval Estimation Threshold (IEThresh)

pool.multiannotator.IntervalEstimationAnnotModel

IELearning

pool.multiannotator.SingleAnnotatorWrapper

Single Annotator Wrapper

skactiveml.pool.utils#

Classes#

pool.utils.IndexClassifierWrapper

Classifier to simplify retraining classifiers in an active learning scenario.

skactiveml.stream#

The skactiveml.stream package implements query strategies for stream-based active learning.

Classes#

stream.StreamRandomSampling

Random Sampling for Data Streams.

stream.PeriodicSampling

Periodic Sampling for Data Streams

stream.FixedUncertainty

Fixed Uncertainty Strategy

stream.VariableUncertainty

Variable Uncertainty Strategy

stream.Split

The Split query strategy (Split Strategy in [R79653b04d29c-1]) queries labels based on the classifiers uncertainty assessed based on the classifier's predictions.

stream.StreamProbabilisticAL

Probabilistic Active Learning in Datastreams

stream.RandomVariableUncertainty

The RandomVariableUncertainty (Uncertainty Strategy With Randomization in [R7113787876b0-1]) query strategy samples samples based on the classifier's uncertainty assessed based on the classifier's predictions.

stream.StreamDensityBasedAL

The StreamDensityBasedAL [Rddab91d1dd87-1] query strategy is an extension to the uncertainty based query strategies proposed by Žliobaitė et al. [Rddab91d1dd87-2].

stream.CognitiveDualQueryStrategy

This class is the base for the CognitiveDualQueryStrategy query strategy proposed in [R1e46791e62c8-1].

stream.CognitiveDualQueryStrategyRan

This class implements the CognitiveDualQueryStrategy [Rffbcc2a90939-1] strategy with Random Sampling.

stream.CognitiveDualQueryStrategyRanVarUn

This class implements the CognitiveDualQueryStrategy [R291d9e1f2fe6-1] strategy with RandomVariableUncertainty.

stream.CognitiveDualQueryStrategyVarUn

This class implements the CognitiveDualQueryStrategy [Rb64f38603851-1] strategy with VariableUncertainty.

stream.CognitiveDualQueryStrategyFixUn

This class implements the CognitiveDualQueryStrategy [R68dceac87beb-1] strategy with FixedUncertainty.

skactiveml.stream.budgetmanager#

The skactiveml.stream.budgetmanager package implements budget managers, which are capable of modeling the budget constraints in stream-based active learning settings.

Classes#

stream.budgetmanager.EstimatedBudgetZliobaite

Budget manager which checks, whether the specified budget has been exhausted already.

stream.budgetmanager.FixedUncertaintyBudgetManager

Budget Manager for Fixed Uncertainty Strategy

stream.budgetmanager.VariableUncertaintyBudgetManager

Budget Manager for Variable Uncertainty Strategy

stream.budgetmanager.SplitBudgetManager

Budget Manager for Split Strategy

stream.budgetmanager.BalancedIncrementalQuantileFilter

Balanced Incremental Quantile Filter (BIQF)

stream.budgetmanager.RandomVariableUncertaintyBudgetManager

Budget Manager for Uncertainty Strategy With Randomization

stream.budgetmanager.DensityBasedSplitBudgetManager

Budget Manager for DBALStream

stream.budgetmanager.RandomBudgetManager

Budget manager which checks, whether the specified budget has been exhausted already.

skactiveml.classifier#

The skactiveml.classifier module.

Classes#

classifier.ParzenWindowClassifier

Parzen Window Classifier (PWC)

classifier.MixtureModelClassifier

Classifier based on a Mixture Model (CMM)

classifier.SklearnClassifier

Sklearn Classifier

classifier.SlidingWindowClassifier

Sliding Window Classifier

skactiveml.classifier.multiannotator#

Classes#

classifier.multiannotator.AnnotatorLogisticRegression

Logistic Regression for Crowds

classifier.multiannotator.AnnotatorEnsembleClassifier

Ensemble of Annotator-wise Classifier

skactiveml.visualization#

The skactiveml.visualization module includes various tools for visualization.

Functions#

visualization.plot_utilities

Plot the utility for the given single-annotator query strategy.

visualization.plot_decision_boundary

Plot the decision boundary of the given classifier.

visualization.plot_contour_for_samples

Plot the utility for the given query strategy.

visualization.plot_annotator_utilities

Plot the utility for the given query strategy.

visualization.plot_stream_training_data

Plot the utility for the given query strategy.

visualization.plot_stream_decision_boundary

Plot the decision boundary of the given classifier.

visualization.mesh

Function to get samples of a mesh grid as well as x-mesh and y-mesh with given resolution in the specified bounds.

skactiveml.utils#

The skactiveml.utils module includes various utilities.

Classes#

utils.ExtLabelEncoder

Encode class labels with value between 0 and classes-1 and uses -1 for unlabeled samples.

Functions#

utils.rand_argmax

Returns index of maximum value.

utils.rand_argmin

Returns index of minimum value.

utils.compute_vote_vectors

Counts number of votes per class label for each sample.

utils.majority_vote

Assigns a label to each sample based on weighted voting.

utils.is_unlabeled

Creates a boolean mask indicating missing labels.

utils.is_labeled

Creates a boolean mask indicating present labels.

utils.check_classes

Check whether class labels are uniformly strings or numbers.

utils.check_missing_label

Check whether a missing label is compatible to a given target type.

utils.check_cost_matrix

Check whether cost matrix has shape (n_classes, n_classes).

utils.check_scalar

Validate scalar parameters type and value.

utils.check_classifier_params

Check whether the parameters are compatible to each other (only if classes is not None).

utils.check_X_y

Input validation for standard estimators.

utils.check_random_state

Check validity of the given random state.

utils.call_func

Calls a function with the given parameters given in kwargs, if they exist as parameters in f_callable.

utils.match_signature

A decorator that matches the signature to a given method from a reference and hides it when the reference object does not have the wrapped function.

utils.check_class_prior

Check if the class_prior is a valid prior.

utils.ext_confusion_matrix

Compute confusion matrix [R3479f72bc894-1] to evaluate the accuracy of a classification.

utils.labeled_indices

Return an array of indices indicating present labels.

utils.unlabeled_indices

Return an array of indices indicating missing labels.

utils.check_type

Check if obj is one of the given types.

utils.check_bound

Validates bound and returns the bound of X if bound is None.

utils.check_equal_missing_label

Check whether two missing label values are equal to each other.

utils.check_budget_manager

Validate if budget_manager is a budget manager class and create a copy budget_manager_.

utils.check_indices

Check if indices fit to array.

utils.simple_batch

Generates a batch by selecting the highest values in the utilities.

utils.check_n_features

Validate and update the number of features for an estimator based on the input data.

utils._check_callable

Checks if func is a callable and if the number of free parameters is correct.

skactiveml.exceptions#

Classes#

exceptions.MappingError

Exception class to raise if a strategy needs a mapping between samples and candidates which is not available.