Path: blob/master/Week 2/Octave Tutorial/5. Control & Methods/control_methods.txt
625 views
GNU Octave, version 4.4.11Copyright (C) 2018 John W. Eaton and others.2This is free software; see the source code for copying conditions.3There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or4FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.56Octave was configured for "x86_64-w64-mingw32".78Additional information about Octave is available at https://www.octave.org.910Please contribute if you find this software useful.11For more information, visit https://www.octave.org/get-involved.html1213Read https://www.octave.org/bugs.html to learn how to submit bug reports.14For information about changes from previous versions, type 'news'.1516octave:1> pwd17ans = C:\Users\amlan18octave:2> cd 'C:\Users\amlan\Documents\Git Repos\Machine Learning\Coursera_ML_Andrew\Octave Tutorial\5. Control & Metho19ds'20octave:3> squareThosNumber(5)21error: 'squareThosNumber' undefined near line 1 column 122octave:3> squareThisNumber(5)23ans = 2524octave:4> X = [1 1;1 2;1 3]25X =26271 1281 2291 33031octave:5> y =[1; 2; 3]32y =333413523633738octave:6> theta =[0;1];39octave:7> theta40theta =414204314445octave:8> j = costFunction(X, y, theta);46147248349octave:9> j50j = 051octave:10> j = costFunction(X, y, theta);52153254355octave:11> j = costFunction(X, y, theta)56157258359j = 060octave:12> X * theta61ans =626316426536667octave:13> X68X =69701 1711 2721 37374octave:14> theta = [0;0]75theta =767707807980octave:15> j = costFunction(X, y, theta)81082083084j = 2185octave:16> X * theta86ans =878808909009192octave:17> j = costFunction(X, y, theta)93094095096j = 2197octave:18> y98y =99100110121023103104octave:19> theta105theta =10610701080109110octave:20> j = costFunction(X, y, theta)111011201130114j = 21115octave:21> j = costFunction(X, y, theta)116011701180119j = 21120octave:22> j = costFunction(X, y, theta)121012201230124j = 21125octave:23> j = costFunction(X, y, theta)126012701280129j = 21130octave:24> j = costFunction(X, y, theta)131No. of training examples1323133No. of predictions134013501360137Squared Errors138sqrErrors139j = 21140octave:25> j = costFunction(X, y, theta)141No. of training examples1423143No. of predictions144014501460147Squared Errors148114941509151j = 21152octave:26> j = costFunction(X, y, theta)153parse error near line 16 of file C:\Users\amlan\Documents\Git Repos\Machine Learning\Coursera_ML_Andrew\Octave Tutorial\5. Control & Methods\costFunction.m154155syntax error156157>>> disp(sum(sqrErrors);158^159160octave:26> j = costFunction(X, y, theta)161parse error near line 16 of file C:\Users\amlan\Documents\Git Repos\Machine Learning\Coursera_ML_Andrew\Octave Tutorial\5. Control & Methods\costFunction.m162163syntax error164165>>> disp(sum(sqrErrors);166^167168octave:26> j = costFunction(X, y, theta)169No. of training examples1703171No. of predictions172017301740175Squared Errors176117741789179j = 2.3333180octave:27>181182