Going from logistic regression to single-layer neural networks