Generalizations and Applications of the Stochastic Block Model to Basketball Games and Variable Selection Problems