The coefficient of determination (R-squared) is a statistical metric used…