maxfuse.utils.svd_denoise
- maxfuse.utils.svd_denoise(arr, n_components=20, randomized=False, n_runs=1)[source]
Compute best rank-n_components approximation of arr by SVD.
- Parameters:
arr (np.array of shape (n_samples, n_features)) – Data matrix
n_components (int, default=20) – Number of components to keep
randomized (bool, default=False) – Whether to use randomized SVD
n_runs (int, default=1) – Run multiple times and take the realization with the lowest Frobenious reconstruction error
- Returns:
arr (array_like of shape (n_samples, n_features)) – Rank-n_comopnents approximation of the input arr.