Batch Gradient Descent Algorithm