Created
January 9, 2015 00:28
-
-
Save digorithm/9fc7a2aaf613c1b2074a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void execute(){ | |
do { | |
this.theta1 -= alpha * deriveTheta1(); | |
this.theta0 -= alpha * deriveTheta0(); | |
//used for plotting | |
tplot[iters] = iters; | |
theta0plot[iters] = theta0; | |
theta1plot[iters] = theta1; | |
iters++; | |
if (iters % dispiter == 0){ | |
addTrendLine(plot, true); | |
} | |
if (iters > maxiter) break; | |
} while (Math.abs(theta1) > tol || Math.abs(theta0) > tol); | |
plot.addScatterPlot("X-Y", initial_data.x, initial_data.y); | |
System.out.println("theta0 = " + this.theta0 + " and theta1 = " + this.theta1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment