In ML, cost functions are used to estimate how badly models are performing. Put simply, *a cost function is a measure of how wrong the model is in terms of its ability to estimate the relationship between X and y.* This cost function (you may also see this referred to as *loss* or *error*.) can be estimated by iterat…