mosaicmpi.dataset.Dataset.validate_cnmf_prediction_errors

mosaicmpi.dataset.Dataset.validate_cnmf_prediction_errors#

Dataset.validate_cnmf_prediction_errors(tolerance: float = 0.0001) DataFrame#

Validate the dataset and cNMF solutions for each rank by comparing the prediction error values stored in the object [self.adata.uns.kvals] to those calculated from the dataset’s data matrices [based on self.adata.X and self.adata.varm[‘cnmf_gep_raw’]]. This can be a quick and sensitive way to assess that the dataset and the cNMF solutions have not been altered.

Parameters:

tolerance (float, optional) – maximum relative error for any k when computing the prediction error, defaults to 0.0001

Raises:

ValueError – if the maximum relative error exceeds the tolerance

Returns:

DataFrame with stored and computed prediction error, and relative error for each rank

Return type:

pd.DataFrame