If you really need MATLAB emulation, use Octave: http://www.gnu.org/software/octave/. It's essentially designed to be a free version of MATLAB. It has virtually identical syntax, operations, etc. Getting it to work on a Windows machine can be a pain, though -- I used Cygwin, a unix emulator for Windows: http://www.cygwin.com/
Hello world. I'm a mobile developer living in NJ and working in NY. I write games in my spare time, and signed up for both this and the ai class, and am currently beefing up my maths in preparation via Khan Academy :-)
I used SciLab quite a bit, and though it's not compatible with matlab, it's more or less the same language and it has a decent number of toolboxes... You might want to check it out. (http://www.scilab.org/)
Also, I don't think they will make any homework/test assignments that will require matlab or be really hard to do in octave. And if they do, I hope we'll make some kind of group effort to share library code & develop our own toolboxes :)
Octave does have booleans, but it calls them "logical values". See Logical Values in the Octave documentation. You can convert a logical value to a numeric value using a conversion function such as double. You can see this in use in ex2.m when computing the training accuracy: the comparison result gives a logical matrix, which is then coerced to a double matrix, over which the mean is computed:
fprintf('Train Accuracy: %f\n', mean(double(p == y)) * 100);
You can examine the type of an expression using the class function, like so:
octave-3.4.0:133> class(1 == 1) ans = logical octave-3.4.0:134> class(double(1 == 1)) ans = double
If the first executable line of a .m file is not a function definition, the file is a script file and all of the variables and functions in the file will be imported into the global namespace. See http://www.gnu.org/software/octave/doc/interpreter/Script-Files.html#Script-Files
If the first line defines a function, then any other functions in the file are "subfunctions" and only accessible from within that file. http://www.gnu.org/software/octave/doc/interpreter/Subfunctions.html#Subfunctions
If you are on a mac and not using Emacs, using Octave Mode to edit .m files and run Octave inside Emacs, I can't suggest it enough!
http://www.gnu.org/software/octave/doc/interpreter/Emacs-Octave-Support.html#Emacs-Octave-Support
Holy fuck. You weren't even exaggerating.
It took all of my self-control to not get like this
Using firefox cookies extension to save the authentication and something like this: https://addons.mozilla.org/en-US/firefox/addon/export-cookies/
for i in seq 2 44
; do wget --load-cookies cookies.txt "http://www.ml-class.org/course/video/download?video_id=${i}"; done
Dig through the archives of NeuroImage. Every issue has a section of "Methods and Modelling" papers. You can get an idea of how others have used SVMs (they come up fairly often).
This is what you are looking for.
and then this:
http://www.khanacademy.org/video/optimization-with-calculus-1?playlist=Calculus
If you know C, the only differences that matter for the homework are the for loop syntax and array/matrix indexing. Any functions that might be useful he covers explicitly.
If a second trip through the Octave tutorials don't help, try Project Euler. It's language agnostic and oriented towards mathematical reasoning.
One way to avoid timeout is to use persistent variables for C and sigma. Persistent variables keep their value between function calls (if the function source has not been modified). So in this case the dataset3Params function would look like:
function [C, sigma] = dataset3Params(X, y, Xval, yval) persistent C; persistent sigma; persistent hasRun; % used to check if the function ran before
if (isempty(hasRun)) % variables are empty if declared without definition hasRun = true; % original dataset3Params code here end
end
Bear in mind that the function has to be called at least once before submitting it.
Here is a worked example: http://www.codeproject.com/KB/recipes/handwriting-svm.aspx
ESL section 11.7 says accuracy is competitive with the best neural nets.
Basically, you could use the same approach as your ANN: Each pixel as a feature, plug, and chug. As with the NNs discussed in ESL, I think you would get better-than-naive accuracy by manually mapping each 3x3 pixel region as a feature, and using non-statistical computer-vision convolution techniques to compute features (edges, corners) to use as input.
I have a hunch that one can do well using the much more popular R http://www.r-project.org for the needs of this class. It also has a slick GUI http://rstudio.org which can run on a webserver for multi-client access. R is stats focused instead of matrix focused, but for intro ML I am confident both programs are able.
I guess the official homework is in Octave/Matlab, but since the points don't matter, don't let that hold you back.
I have been slowly working through the cs229 lectures and homework problems online, and boning up on prerequisites as it makes sense. Watching MIT Linear Algebra lectures by Strang has been very helpful. Also, if you're as rusty as I was/am, brushing up on probability and statistics is a good idea. I haven't found a stellar online reference or class, but I'm currently taking a look at thinkstats - http://thinkstats.com.
Sad to admit, but there were places where my calculus needed help getting back to fluency. (Andrew Ng's class does quite a bit of matrix calculus.) The Calculus Lifesaver lectures http://www.metafilter.com/88256/Calculus-Lifesaver are verbose, but good for targeted review.
So you have row_vector = (h(x_i) - y)
And you want to do something with "* x_i"
Have you tried "row_vector * x_i" ?
https://www.youtube.com/watch?v=SgMMkZJsOpk
Oh, maybe this is what you are thinking:
(Warning: switching notation from x_i to x(i).)
The formula for theta: θ_j := θ_j − α/2 * sum(hθ(x(i)) − y(i))x(i)
Are you thinking this?: (sum(hθ(x(i)) − y(i))) * x(i)
You should be thinking this: sum( (hθ(x(i)) − y(i)) * x(i) )
Multiply by x(i) inside the sum.
Buenas, desde el reddit de AI hemos creado uno para ese curso, pero hay gente también de los otros dos así que en principio no habría problema en utilizarlo para este también:
I tried to use the symbolic package a few months ago and it was very much broken. I am not sure if the package has been fixed, but there certainly are many tutorials out there.
After a while I kinda gave up and started using maxima, I will check the symbolic package again when I get home to my ubuntu/linux Desktop.
honestly all I did was googe for "octave symbolic tutorial" and looked at whatever came up. AFAIK the octave symbolic is not as well developed as matlab, I reckon that perhaps scilab has a better symolic package since I heard it was based on maxima, but that is just and entirely different mathematical environment.
This is one of the instances where the differences between matlab and octave become apparent. I wish I could help you more but I am really short on time. gl.
I'm not sure, but can you try "axis equal"? Does that fix the issue?
I'm frequently on Octave IRC, so if you prefer to chat about it, we can do it there:
Here is an undergraduate summer research project on Centroidal Voronoi Tesselations, which is a fancy name for clustering.
I don't really know php but some quick googling turned up this. So I believe the equivalent expression would be this:
fminunc( function($t) use ($X, $y, $lambda) { return costFunctionReg($t, $X, $y, $lambda); }, $initial_theta, $options);
That example is probably full of errors so I suggest you read the page yourself.
I couldn't get gnuplot or aquaterm to work with octave either. I tried the different recommendation mentioned online for tweaking octave files and gnuplot files, but whenever i try to plot, aquaterm launches , but no plots are displayed. I don't have the unix background to figure this out.
Tried the stuff here
I'll have to try your workaround to see if that will help.