changeset 5:a4c4da8f4ac0

Style fixes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 08 Nov 2011 00:56:18 -0500
parents 4fb05328d3cf
children 141d81a2acf5
files costFunction.m plotData.m predict.m sigmoid.m
diffstat 4 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/costFunction.m
+++ b/costFunction.m
@@ -12,4 +12,4 @@
   J = -sum (y.*log (ht) + (1 - y).*log (1 - ht))/m
   grad = X'*(ht - y)/m;
 
-end
+endfunction
--- a/plotData.m
+++ b/plotData.m
@@ -1,19 +1,19 @@
 function plotData(X, y)
-##PLOTDATA Plots the data points X and y into a new figure 
-##   PLOTDATA(x,y) plots the data points with + for the positive examples
-##   and o for the negative examples. X is assumed to be a Mx2 matrix.
+  ##PLOTDATA Plots the data points X and y into a new figure 
+  ##   PLOTDATA(x,y) plots the data points with + for the positive examples
+  ##   and o for the negative examples. X is assumed to be a Mx2 matrix.
 
-## Create New Figure
-figure; hold on;
+  ## Create New Figure
+  figure; hold on;
 
-## Find Indices of Positive and Negative Examples
-pos = find(y==1); neg = find(y == 0);
-## Plot Examples
-plot (X(pos, 1), X(pos, 2), "k+","LineWidth", 2, 
-      "MarkerSize", 7);
-plot (X(neg, 1), X(neg, 2), "ko", "MarkerFaceColor", 
-      "y", "MarkerSize", 7);
+  ## Find Indices of Positive and Negative Examples
+  pos = find(y==1); neg = find(y == 0);
+  ## Plot Examples
+  plot (X(pos, 1), X(pos, 2), "k+","LineWidth", 2, 
+        "MarkerSize", 7);
+  plot (X(neg, 1), X(neg, 2), "ko", "MarkerFaceColor", 
+        "y", "MarkerSize", 7);
 
-hold off;
+  hold off;
 
-end
+endfunction
--- a/predict.m
+++ b/predict.m
@@ -6,4 +6,4 @@
 
   p = sigmoid (X*theta) >= 0.5;
 
-end
+endfunction
--- a/sigmoid.m
+++ b/sigmoid.m
@@ -4,4 +4,4 @@
 
   g = 1./(1 + exp (-z));
 
-end
+endfunction