skactiveml.stream.budgetmanager.BalancedIncrementalQuantileFilter#
- class skactiveml.stream.budgetmanager.BalancedIncrementalQuantileFilter(w=100, w_tol=50, budget=None)[source]#
Bases:
BudgetManager
The Balanced Incremental Quantile Filter has been proposed together with Probabilistic Active Learning for Datastreams [1]. It assesses whether a given spatial utility (i.e., obtained via ProbabilisticAL) warrants to query the label in question. The spatial ultilities are compared against a threshold that is derived from a quantile (budget) of the last w observed utilities. To balance the number of queries, w_tol is used to increase or decrease the threshold based on the number of available acquisitions.
- Parameters
- wint, optional (default=100)
The number of observed utilities that are used to infer the threshold. w should be higher than 0.
- w_tolint, optional (default=50)
The window in which the number of acquisitions should stay within the budget. w_tol should be higher than 0.
- budgetfloat, optional (default=None)
Specifies the ratio of instances which are allowed to be queried, with 0 <= budget <= 1. See Also
BudgetManager
.
References
- [1] Kottke D., Krempl G., Spiliopoulou M. (2015) Probabilistic Active
Learning in Datastreams. In: Fromont E., De Bie T., van Leeuwen M. (eds) Advances in Intelligent Data Analysis XIV. IDA 2015. Lecture Notes in Computer Science, vol 9385. Springer, Cham.
Methods
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
query_by_utility
(utilities)Ask the budget manager which utilities are sufficient to query the corresponding instance.
set_params
(**params)Set the parameters of this estimator.
update
(candidates, queried_indices, utilities)Updates the budget manager.
- get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns
- routingMetadataRequest
A
MetadataRequest
encapsulating routing information.
- get_params(deep=True)#
Get parameters for this estimator.
- Parameters
- deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns
- paramsdict
Parameter names mapped to their values.
- query_by_utility(utilities)[source]#
Ask the budget manager which utilities are sufficient to query the corresponding instance.
- Parameters
- utilitiesndarray of shape (n_samples,)
The utilities provided by the stream-based active learning strategy, which are used to determine whether sampling an instance is worth it given the budgeting constraint.
- Returns
- queried_indicesndarray of shape (n_queried_instances,)
The indices of instances represented by utilities which should be queried, with 0 <= n_queried_instances <= n_samples.
- set_params(**params)#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters
- **paramsdict
Estimator parameters.
- Returns
- selfestimator instance
Estimator instance.
- update(candidates, queried_indices, utilities)[source]#
Updates the budget manager.
- Parameters
- candidates{array-like, sparse matrix} of shape
- (n_samples, n_features)
The instances which could be queried. Sparse matrices are accepted only if they are supported by the base query strategy.
- queried_indicesarray-like
Indicates which instances from candidates have been queried.
- utilitiesndarray of shape (n_samples,)
The utilities based on the query strategy.
- Returns
- selfEstimatedBudget
The EstimatedBudget returns itself, after it is updated.