Skip to content

Instantly share code, notes, and snippets.

@achrafsoltani
Created April 18, 2022 20:25
Show Gist options
  • Save achrafsoltani/116a668fa00dca8afa637853c4decd29 to your computer and use it in GitHub Desktop.
Save achrafsoltani/116a668fa00dca8afa637853c4decd29 to your computer and use it in GitHub Desktop.
function derivatives = compute_derivatives(X, Y, theta0, theta1, m)
derivatives(1) = (1/m)*sum((theta0+(theta1*X))-Y);
derivatives(2) = (1/m)*sum(X.*((theta0+(theta1*X))-Y));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment