1. A computer implemented method of grouping a collection of web pages into a plurality of groups, comprising: obtaining training examples of the web pages in the plurality of groups, each training example having a target function value, wherein obtaining training examples comprises obtaining a plurality of web pages in their collection that are labeled by a trusted entity as spam training pages, and also further comprises obtaining a plurality of web pages in the collection that are labeled by the trusted entity as normal training pages; performing a random walk over a directed graph representing the collection of web pages to obtain stationary probabilities associated with nodes in the directed graph, the nodes representing the web pages in the collection; identifying a classification function that assigns a classification function value to each of the nodes in the directed graph based on the stationary probabilities associated with the nodes, based on classification function values assigned to other nodes in the directed graph, and based on the target function values; and labeling nodes in the directed graph as belonging to one of the plurality of groups based on classification function values assigned to the nodes by the identified classification function.