actsnclass.uncertainty_sampling

actsnclass.uncertainty_sampling(class_prob: numpy.array, test_ids: numpy.array, queryable_ids: numpy.array, batch=1, screen=False, query_thre=1.0) → list

Search for the sample with highest uncertainty in predicted class.

Parameters:
  • class_prob (np.array) – Classification probability. One value per class per object.
  • test_ids (np.array) – Set of ids for objects in the test sample.
  • queryable_ids (np.array) – Set of ids for objects available for querying.
  • batch (int (optional)) – Number of objects to be chosen in each batch query. Default is 1.
  • screen (bool (optional)) – If True display on screen the shift in index and the difference in estimated probabilities of being Ia caused by constraints on the sample available for querying.
  • query_thre (float (optional)) – Maximum percentile where a spectra is considered worth it. If not queryable object is available before this threshold, return empty query. Default is 1.0.
Returns:

query_indx – List of indexes identifying the objects from the test sample to be queried in decreasing order of importance. If there are less queryable objects than the required batch it will return only the available objects – so the list of objects to query can be smaller than ‘batch’.

Return type:

list