Generalizations of principal component analysis, optimization problems, and neural networks