One-step regression and classification with crosspoint resistive memory arrays