alipy.query_strategy.multi_labels. QueryMultiLabelRandom

Select instance or instance-label pairs randomly.

Methods

select

select(self, label_index, unlabel_index, batch_size=1, select_type='ins-lab', **kwargs)
Parameters:
X: 2D array
Feature matrix of the whole dataset. It is a reference which will not use additional memory.
y: array-like
Label matrix of the whole dataset. It is a reference which will not use additional memory.
lambda: float, optional (default=1.0)
A regularization parameter used in the regularization learning
framework.
kernel : {'linear', 'poly', 'rbf', callable}, optional (default='rbf')
Specifies the kernel type to be used in the algorithm.
It must be one of 'linear', 'poly', 'rbf', or a callable.
If a callable is given it is used to pre-compute the kernel matrix
from data matrices; that matrix should be an array of shape
``(n_samples, n_samples)``.
degree : int, optional (default=3)
Degree of the polynomial kernel function ('poly').
Ignored by all other kernels.
gamma : float, optional (default=1.)
Kernel coefficient for 'rbf', 'poly'.
coef0 : float, optional (default=1.)
Independent term in kernel function.
It is only significant in 'poly'.

select

select(self, label_index, unlabel_index, **kwargs)

Select a subset from the unlabeled set, return the selected instance and label.

Parameters:
label_index: {list, np.ndarray, MultiLabelIndexCollection}
The indexes of labeled samples. It should be a 1d array of indexes (column major, start from 0) or
MultiLabelIndexCollection or a list of tuples with 2 elements, in which,
the 1st element is the index of instance and the 2nd element is the index of labels.
unlabel_index: {list, np.ndarray, MultiLabelIndexCollection}
The indexes of unlabeled samples. It should be a 1d array of indexes (column major, start from 0) or
MultiLabelIndexCollection or a list of tuples with 2 elements, in which,
the 1st element is the index of instance and the 2nd element is the index of labels.
Returns:
selected_ins_lab_pair: list
A list of tuples that contains the indexes of selected instance-label pairs.

Copyright © 2018, alipy developers (BSD 3 License).