Explorar el Código

incl optional ex

astron hace 7 años
padre
commit
98506e78ca

BIN
machine learning/machine-learning-ex5/ex5/octave-workspace


+ 27 - 0
machine learning/machine-learning-ex5/ex5/validateFinal.m

@@ -0,0 +1,27 @@
+function [error_test] = ...
+    validateFinal(X_poly, y, X_poly_test, ytest, lambda)
+
+m = rows(X_poly);
+error_test = zeros(m, 1);
+
+for i = 1:m
+  theta = trainLinearReg(X_poly, y, lambda);  
+  [error_test(i,:), grad] = linearRegCostFunction(X_poly_test, ytest, theta, 0);
+  
+
+
+  
+  
+endfor
+
+
+error_test
+
+
+
+
+
+
+% =========================================================================
+
+end