A PCA approach to stellar effective temperatures