API Reference#
This is an overview of the API.
skactiveml.base
:#
The skactiveml.base
package implements the base classes for
skactiveml
.
Classes#
Base class for all query strategies in scikit-activeml. |
|
Base class for all pool-based active learning query strategies with a single annotator in scikit-activeml. |
|
Base class for all pool-based active learning query strategies with multiple annotators in scikit-activeml. |
|
Base class for all budget managers for stream-based active learning in scikit-activeml to model budgeting constraints. |
|
Base class for all stream-based active learning query strategies in scikit-activeml. |
|
Base class for scikit-activeml classifiers such that missing labels, user-defined classes, and cost-sensitive classification (i.e., cost matrix) can be handled. |
|
Extends scikit-activeml classifiers to estimators that are able to estimate class frequencies for given samples (by calling 'predict_freq'). |
|
Base class of all annotator models estimating the performances of annotators for given samples. |
|
Base class for scikit-activeml regressors. |
|
Base class for scikit-activeml probabilistic regressors. |
skactiveml.pool
:#
The skactiveml.pool
package implements query strategies for
pool-based active learning.
Classes#
Random Sampling. |
|
(Multi-class) Probabilistic Active Learning |
|
Uncertainty Sampling. |
|
Epistemic Uncertainty Sampling. |
|
This class implements the expected error method from [1] that uses a Monte-Carlo approach to estimate the error. |
|
This class implements the expected error method from [1] that estimates the value of information. |
|
Query-by-Committee (QBC) |
|
Implementation of the AL strategy "QUerying Informative and Representative Examples" (QUIRE for short) [1]. |
|
Implementation of the pool-based query strategy 4DS for training a MixtureModelClassifier [1]. |
|
Active Learning with Cost Embedding (ALCE). |
|
Expected Model Change. |
|
Regression based Expected Model Output Change. |
|
Expected Model Variance Reduction. |
|
Regression based Kullback Leibler Divergence Maximization. |
|
Greedy Sampling on the feature space. |
|
Greedy Sampling on the target space. |
|
Discriminative Active Learning. |
|
Batch Bayesian Active Learning by Disagreement (BatchBALD) |
|
Clustering Uncertainty-weighted Embeddings (CLUE) |
|
Core Set |
|
Typical Clustering |
|
Batch Active Learning by Diverse Gradient Embedding (BADGE) |
|
Probability Coverage |
|
Contrastive Active Learning (ContrastiveAL) |
|
Greedy Bayesian Active Learning by Disagreement (GreedyBALD) |
|
Regression Tree-based Active Learning |
|
Sub-sampling Wrapper. |
|
Parallel Utility Estimation Wrapper. |
Functions#
Calculate the expected cost reduction. |
|
Computes uncertainty scores. |
|
Calculate the expected average precision. |
|
Calculates the average Kullback-Leibler (KL) divergence for measuring the level of disagreement in QueryByCommittee. |
|
Calculates the vote entropy for measuring the level of disagreement in QueryByCommittee. |
|
Calculates the variation ratios for measuring the level of disagreement in QueryByCommittee. |
|
BatchBALD: Efficient and Diverse Batch Acquisition for Deep Bayesian Active Learning |
|
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#
The strategy 'Interval Estimation Threshold' (IEThresh) [1] is useful for addressing the exploration vs. |
|
This annotator model relies on 'Interval Estimation Learning' (IELearning) for estimating the annotation performances, i.e., labeling accuracies, of multiple annotators [1]. |
|
Implementation of a wrapper class for pool-based active learning query strategies with a single annotator such that it transforms the query strategy for the single annotator into a query strategy for multiple annotators by choosing an annotator randomly or according to the parameter A_pef and setting the labeled matrix to a labeled vector by an aggregation function, e.g., majority voting. |
skactiveml.pool.utils
:#
Classes#
Classifier to simplify retraining classifiers in an active learning scenario. |
skactiveml.stream
:#
The skactiveml.stream
module implements query strategies for
stream-based active learning.
Classes#
Random Sampling for Datastreams. |
|
The PeriodicSampling samples instances periodically. |
|
The FixedUncertainty (Fixed-Uncertainty in [1]) query strategy samples instances based on the classifiers uncertainty assessed based on the classifier's predictions. |
|
The VariableUncertainty (Var-Uncertainty in [1]) query strategy samples instances based on the classifiers uncertainty assessed based on the classifier's predictions. |
|
The Split [1] query strategy samples in 100*v% of instances randomly and in 100*(1-v)% of cases according to VariableUncertainty. |
|
Probabilistic Active Learning in Datastreams (StreamProbabilisticAL) is an extension to Multi-Class Probabilistic Active Learning (McPAL) (see pool.ProbabilisticAL). |
|
The RandomVariableUncertainty (Ran-Var-Uncertainty in [1]) query strategy samples instances based on the classifier's uncertainty assessed based on the classifier's predictions. |
|
The StreamDensityBasedAL [1] query strategy is an extension to the uncertainty based query strategies proposed by Žliobaitė et al. [2]. |
|
This class is the base for the CognitiveDualQueryStrategy query strategy proposed in [1]. |
|
This class implements the CognitiveDualQueryStrategy strategy with Random Sampling. |
|
This class implements the CognitiveDualQueryStrategy strategy with RandomVariableUncertainty. |
|
This class implements the CognitiveDualQueryStrategy strategy with VariableUncertainty. |
|
This class implements the CognitiveDualQueryStrategy strategy with FixedUncertainty. |
skactiveml.stream.budgetmanager
:#
The skactiveml.stream.budgetmanager
module implements budget managers,
which are capable of modeling the budget constraints in stream-based active
learning settings.
Classes#
Budget manager which checks, whether the specified budget has been exhausted already. |
|
Budget manager which is optimized for FixedUncertainty and checks, whether the specified budget has been exhausted already. |
|
Budget manager which checks, whether the specified budget has been exhausted already. |
|
Budget manager which checks, whether the specified budget has been exhausted already. |
|
The Balanced Incremental Quantile Filter has been proposed together with Probabilistic Active Learning for Datastreams [1]. |
|
Budget manager which checks, whether the specified budget has been exhausted already. |
|
Budget manager which checks, whether the specified budget has been exhausted already. |
|
Budget manager which checks, whether the specified budget has been exhausted already. |
skactiveml.classifier
:#
The skactiveml.classifier
module.
Classes#
The Parzen window classifier (PWC) is a simple and probabilistic classifier. |
|
The classifier based on a mixture model (MixtureModelClassifier) is a generative classifier based on a (Bayesian) Gaussian mixture model (GMM). |
|
Implementation of a wrapper class for scikit-learn classifiers such that missing labels can be handled. |
|
Implementation of a wrapper class for SkactivemlClassifier such that the number of training samples can be limited to the latest window_size samples. |
skactiveml.classifier.multiannotator
:#
Classes#
Logistic Regression based on Raykar [1] is a classification algorithm that learns from multiple annotators. |
|
This strategy consists of fitting one classifier per annotator. |
skactiveml.visualization
:#
The skactiveml.visualization
module includes various tools for
visualization.
Functions#
Plot the utility for the given single-annotator query strategy. |
|
Plot the decision boundary of the given classifier. |
|
Plot the utility for the given query strategy. |
|
Plot the utility for the given query strategy. |
|
Plot the utility for the given query strategy. |
|
Plot the decision boundary of the given classifier. |
|
Function to get instances 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#
Encode class labels with value between 0 and classes-1 and uses -1 for unlabeled samples. |
Functions#
Returns index of maximum value. |
|
Returns index of minimum value. |
|
Counts number of votes per class label for each sample. |
|
Assigns a label to each sample based on weighted voting. |
|
Creates a boolean mask indicating missing labels. |
|
Creates a boolean mask indicating present labels. |
|
Check whether class labels are uniformly strings or numbers. |
|
Check whether a missing label is compatible to a given target type. |
|
Check whether cost matrix has shape (n_classes, n_classes). |
|
Validate scalar parameters type and value. |
|
Check whether the parameters are compatible to each other (only if classes is not None). |
|
Input validation for standard estimators. |
|
Check validity of the given random state. |
|
Calls a function with the given parameters given in kwargs if they exist as parameters in f_callable. |
|
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. |
|
Check if the class_prior is a valid prior. |
|
Compute confusion matrix to evaluate the accuracy of a classification. |
|
Return an array of indices indicating present labels. |
|
Return an array of indices indicating missing labels. |
|
Check if obj is one of the given types. |
|
Validates bound and returns the bound of X if bound is None. |
|
Check whether two missing label values are equal to each other. |
|
Validate if budget manager is a budgetmanager class and create a copy 'budget_manager_'. |
|
Check if indices fit to array. |
|
Generates a batch by selecting the highest values in the 'utilities'. |
|
Checks if function is a callable and if the number of free parameters is correct. |
skactiveml.exceptions
:#
Classes#
Exception class to raise if a strategy needs a mapping between samples and candidates which is not available. |