- MatrixSolverOutput.sparsify(mode, value=None, batch_size=1024, n_samples=None, seed=None)#
This function only serves for interfacing software which has to instantiate the transport matrix,
moscotnever uses the sparsified transport matrix.
How to determine the value below which entries are set to \(0\). Valid options are:
valueis the threshold below which entries are set to \(0\).
valueis the percentile in \([0, 100]\) of the
transport_matrix. below which entries are set to \(0\).
valueis not used, it is chosen such that each row has at least 1 non-zero entry.
int]) – If
mode = 'percentile', determine the number of samples based on which the percentile is computed stochastically. Note this means that a matrix of shape [n_samples, min(transport_matrix.shape)] has to be instantiated. If None,
n_samplesis set to
- Return type:
: Output with sparsified transport matrix.