skactiveml.stream.budgetmanager.FixedUncertaintyBudgetManager#

class skactiveml.stream.budgetmanager.FixedUncertaintyBudgetManager(budget=None, w=100, num_classes=2)[source]#

Bases: EstimatedBudgetZliobaite

Budget manager which is optimized for FixedUncertainty and checks, whether the specified budget has been exhausted already. If not, an instance is queried, when the utility is higher than the specified budget and the probability of the most likely class exceeds a threshold calculated based on the budget and the number of classes. See also EstimatedBudgetZliobaite

Parameters
budgetfloat, optional (default=None)

Specifies the ratio of instances which are allowed to be queried, with 0 <= budget <= 1. See Also BudgetManager.

wint, optional (default=100)

Specifies the size of the memory window. Controlles the budget in the last w steps taken. Default = 100

num_classesint, optional (default=2)

Specifies the number of classes. Default = 2

Methods

get_metadata_routing()

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)

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.

return_utilitiesbool, optional

If true, also return whether there was budget left for each assessed utility. The default is False.

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)[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 of shape (n_samples,)

Indicates which instances from candidates have been queried.

Returns
selfFixedUncertaintyBudgetManager

The FixedUncertaintyBudget returns itself, after it is updated.