Prediction and optimization of wave energy converter arrays using a machine learning approach