Label propagation for classification and ranking