One-versus-all and one-versus-one classification