optimized hash logistic regression