On the algebraic classification of pseudo-Riemannian spaces