Disclosed is a general learning framework for computer implementation that induces sparsity on the undirected graphical model imposed on the vector of latent factors. A latent factor model SLFA is disclosed as a matrix factorization problem with a special regularization term that encourages collaborative reconstruction. Advantageously, the model may simultaneously learn the lower-dimensional representation for data and model the pairwise relationships between latent factors explicitly. An on-line learning algorithm is disclosed to make the model amenable to large-scale learning problems. Experimental results on two synthetic data and two real-world data sets demonstrate that pairwise relationships and latent factors learned by the model provide a more structured way of exploring high-dimensional data, and the learned representations achieve the state-of-the-art classification performance.