A penalized matrix decomposition, and its applications