query_strategy.query_labels.
QueryInstanceGraphDensity
QueryInstanceGraphDensity(X, y, train_idx, metric='manhattan')
Diversity promoting sampling method that uses graph density to determine
most representative points.
The implementation refers to the https://github.com/google/active-learning
References
----------
[1] Ebert, S.; Fritz, M.; and Schiele, B. 2012. RALF: A reinforced
active learning formulation for object class recognition.
In 2012 IEEE Conference on Computer Vision and Pattern Recognition,
Providence, RI, USA, June 16-21, 2012,
3626\–3633.
Methods
init
init(self, X, y, train_idx, metric='manhattan')
Parameters:
|
-
X: 2D array, optional (default=None)
-
Feature matrix of the whole dataset. It is a reference which will not use additional memory.
-
y: array-like, optional (default=None)
-
Label matrix of the whole dataset. It is a reference which will not use additional memory.
-
train_idx: array-like
-
the index of training data.
-
metric: str, optional (default='manhattan')
-
the distance metric.
valid metric = ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock',
'braycurtis', 'canberra', 'chebyshev', 'correlation',
'cosine', 'dice', 'hamming', 'jaccard', 'kulsinski',
'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto',
'russellrao', 'seuclidean', 'sokalmichener',
'sokalsneath', 'sqeuclidean', 'yule', "wminkowski"]
|
select
elect(self, label_index, unlabel_index, batch_size=1, **kwargs)
Select indexes from the unlabel_index for querying.
Parameters:
|
-
label_index: {list, np.ndarray, IndexCollection}
-
The indexes of labeled samples.
-
unlabel_index: {list, np.ndarray, IndexCollection}
-
The indexes of unlabeled samples.
-
batch_size: int, optional (default=1)
-
Selection batch size.
|
Returns:
|
-
selected_idx: list
-
The selected indexes which is a subset of unlabel_index.
|