skmultilearn.utils module

skmultilearn.utils.get_matrix_in_format(original_matrix, matrix_format)[source]

Converts matrix to format

Parameters:
  • original_matrix (np.matrix or scipy matrix or np.array of np. arrays) – matrix to convert
  • matrix_format (string) – format
Returns:

matrix – matrix in given format

Return type:

scipy matrix

skmultilearn.utils.measure_per_label(measure, y_true, y_predicted)[source]

Return per label results of a scikit-learn compatible quality measure

Parameters:
  • measure (callable) – scikit-compatible quality measure function
  • y_true (sparse matrix) – ground truth
  • y_predicted (sparse matrix) – the predicted result
Returns:

score from a given measure depending on what the measure returns

Return type:

List[int or float]