recpack.postprocessing.filters.PostFilter

class recpack.postprocessing.filters.PostFilter

Abstract baseclass for postprocessing filter implementations

A filter needs to implement an apply() method, which takes as input a csr_matrix, and returns a processed csr_matrix.

Methods

apply(X_pred)

Process the predictions, and return the processed matrix.

apply_all(*csr_matrices)

Apply the filter to each of the matrices.

abstract apply(X_pred: scipy.sparse._csr.csr_matrix) scipy.sparse._csr.csr_matrix

Process the predictions, and return the processed matrix.

Parameters

X_pred (csr_matrix) – csr_matrix to filter

Returns

The processed csr_matrix.

Return type

csr_matrix

apply_all(*csr_matrices: scipy.sparse._csr.csr_matrix) List[scipy.sparse._csr.csr_matrix]

Apply the filter to each of the matrices.

Parameters

csr_matrices (csr_matrix) – The matrices to apply the filter to.

Returns

The list of processed csr_matrices

Return type

List[csr_matrix]