Logistic regression without matrix-vector multiplication