skactiveml.stream.budgetmanager.EstimatedBudgetZliobaite#
- class skactiveml.stream.budgetmanager.EstimatedBudgetZliobaite(w=100, budget=None)[source]#
Bases:
BudgetManager
Budget manager which checks, whether the specified budget has been exhausted already. If not, a sample is queried, when the utility is higher than the specified budget.
This budget manager calculates the estimated budget [1] spent in the last w steps and compares that to the budget. If the ratio is smaller than the specified budget, i.e., budget - u_t / w > 0, the budget manager queries a sample when its utility is higher than the budget. u is the estimate of how many true labels were queried within the last w steps. The incremental function, u_t = u_t-1 * (w-1) / w + labeling_t, is used to calculate u at time t.
- Parameters
- wint, default=100
Specifies the size of the memory window. Controlls the budget in the last w steps taken.
- budgetfloat, default=None
Specifies the ratio of samples which are allowed to be sampled, with 0 <= budget <= 1. If budget is None, it is replaced with the default budget 0.1.
References
- 1
I. Žliobaitė, A. Bifet, B. Pfahringer, and G. Holmes. Active Learning With Drifting Streaming Data. IEEE Trans. Neural Netw. Learn. Syst., 25(1):27–39, 2014
Methods
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
query_by_utility
(utilities, *args, **kwargs)Ask the budget manager which utilities are sufficient to query the corresponding labels.
set_params
(**params)Set the parameters of this estimator.
update
(candidates, queried_indices)Updates the EstimatedBudgetZliobaite.
- 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.
- abstract query_by_utility(utilities, *args, **kwargs)#
Ask the budget manager which utilities are sufficient to query the corresponding labels.
- Parameters
- utilitiesarray-like of shape (n_samples,)
The utilities provided by the stream-based active learning strategy, which are used to determine whether querying a sample is worth it given the budgeting constraint.
- Returns
- queried_indicesnp.ndarray of shape (n_queried_indices,)
The indices of samples in candidates whose labels are queried, with 0 <= queried_indices <= n_candidates.
- 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)[source]#
Updates the EstimatedBudgetZliobaite.
- Parameters
- candidates{array-like, sparse matrix} of shape (n_samples, n_features)
The samples which may be queried. Sparse matrices are accepted only if they are supported by the base query strategy.
- queried_indicesnp.ndarray of shape (n_queried_indices,)
The indices of samples in candidates whose labels are queried, with 0 <= queried_indices <= n_candidates.
- Returns
- selfEstimatedBudgetZliobaite
The EstimatedBudgetZliobaite returns itself, after it is updated.