asreview.models.balance.TripleBalance.sample

TripleBalance.sample(X, y, train_idx, shared)[source]

Resample the training data.

Parameters:
  • X (numpy.ndarray) – Complete feature matrix.

  • y (numpy.ndarray) – Labels for all papers.

  • train_idx (numpy.ndarray) – Training indices, that is all papers that have been reviewed.

  • shared (dict) – Dictionary to share data between balancing models and other models.

Returns:

numpy.ndarray,numpy.ndarray – X_train, y_train: the resampled matrix, labels.