labeled_indices#
- skactiveml.utils.labeled_indices(y, missing_label=nan, *, target_type='single-output')[source]#
Return an array of indices indicating present labels.
- Parameters:
- yarray-like, shape (n_samples,) or (n_samples, n_outputs)
Class labels to be checked w.r.t. to present labels.
- missing_labelnumber or str or None or np.nan, default=np.nan
Value to represent a missing label.
- target_type“single-output” or “multi-label”, default=”single-output”
The resolved target type. For multi-label targets, y must be two-dimensional. Furthermore, a row y[i] must contain either only observed labels or only missing_label values, i.e., no mixing within a row.
- Returns:
- lbld_indicesnumpy.ndarray of shape (n_samples) or (n_samples, 2)
Index array of present labels.
If target_type=”single-output” and y is a 2D-array, lbld_indices has the shape (n_samples, 2).
Otherwise, lbld_indices has the shape (n_samples,).
Examples using skactiveml.utils.labeled_indices#
Batch Active Learning by Diverse Gradient Embedding (BADGE)
Batch Bayesian Active Learning by Disagreement (BatchBALD)
Fast Active Learning by Contrastive UNcertainty (FALCUN)
Batch Density-Diversity-Distribution-Distance Sampling (4DS)
Density-Diversity-Distribution-Distance Sampling (4DS)
Maximum Loss Reduction with Maximal Confidence (MMC)
Monte-Carlo Expected Error Reduction (EER) with Log-Loss
Monte-Carlo Expected Error Reduction (EER) with Misclassification-Loss
Query-by-Committee (QBC) with Kullback-Leibler Divergence
Querying Informative and Representative Examples (QUIRE)
Uncertainty Sampling with Expected Average Precision (USAP)