I have been learning the coursera Machine Learning Course by Andrew Ng for two weeks now. Machine Learning is fun and different. For the coursera assignment1 of linear regression, I want to share something.
I think matlab is better than octave, please use coursera account. Install matlab
The course use Octave/Matlab for programming practice. I learned octave basics in two days. I don’t have too much time, can just doing these homework in weekends. For Octavel installed on mac, I encounter some problems and solved it. Now octave is 4.2.0, I think ocatve is better now.
if you encounter some problem, you can solve it as follows:
- brew update && brew upgrade
- brew tap –repair
- brew install octave
- install xserver(seems no need to install)
- font can’t find when plot
- export FONTCONFIG_PATH=/opt/X11/lib/X11/fontconfig
- can’t plot unknown or ambiguous terminal type; type just ‘set terminal’ for a list
- brew uninstall gnuplot
- download and install aquaterm: https://sourceforge.net/projects/aquaterm/?source=typ_redirect
- brew install gnuplot –with-aquaterm –with-qt4
- add start config to /usr/local/share/octave/site/m/startup/octaverc
- PS1(‘>> ‘)
Implementing gradient desenct algorithm in vectorization style was more efficient than iteration algorithm. Here is my implementation:
No for loop looks elegant.
Another implementation by my wwzyhao
Not better than me! haha~