Monday, September 16, 2013

A Course in Machine Learning

By  | October 2, 2013
The following content is totally copied from the website of A Course in Machine Learning.
CIML is a set of introductory materials that covers most major aspects of modern machine learning (supervised learning, unsupervised learning, large margin methods, probabilistic modeling, learning theory, etc.). It’s focus is on broad applications with a rigorous backbone. A subset can be used for an undergraduate course; a graduate course could probably cover the entire material and then some.

This book is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it or re-use it under the terms of the CIML License online at ciml.info/LICENSE. You may not redistribute it yourself, but are encouraged to provide a link to the CIML web page for others to download for free. You may not charge a fee for printed versions, though you can print it for your own use.
Individual Chapters:
  1. Front Matter
  2. Decision Trees
  3. Geometry and Nearest Neighbors
  4. The Perceptron
  5. Machine Learning in Practice
  6. Beyond Binary Classification
  7. Linear Models
  8. Probabilistic Modeling
  9. Neural Networks
  10. Kernel Methods
  11. Learning Theory
  12. Ensemble Methods
  13. Efficient Learning
  14. Unsupervised Learning
  15. Expectation Maximization
  16. Semi-Supervised Learning
  17. Graphical Models
  18. Online Learning
  19. Structured Learning
  20. Bayesian Learning
  21. Back Matter

Saturday, September 7, 2013

What are the differences between pointers and references in C++?

Pointers and references look very different (pointers use * and ->, while references use .), but they seem to have the same function: both can be used to indirectly point to another object. So when should you use pointers vs. references?
  • The most important thing you should always remember is that, reference can never be assigned NULL directly. A reference has always to refer to an object. Therefore, if you need a variable that needs to point to nothing sometimes, then this variable should be declared as a pointer, not a reference. The fact that reference should always refer to an object makes the program more effective, because it doesn’t need to be tested null before usage.
  • A pointer can be re-assigned to another object, but a reference cannot. A reference must be assigned at initialization.
  • A pointer can points to a 2nd pointer, which points to a 3rd pointer, … This offers extra levels of indirection. Whereas a reference only offers one level of indirection.
  • Pointers can iterate over an array, you can use ++ to go to the next item, and +n to go to the (n+1)th element. This is no matter what size the object is that the pointer points to.
  • The last situation is that when you need to overload an operator, you should use references rather than pointers. A typical overloaded operator is [], by which an object should be returned. For example
    vector<int> v(10);
    v[5] = 10;
    
    If the operator [] returns a pointer, the last line would be
    *v[5] = 10;
    
    This would make v look like a vector of pointers.
Also, a pointer has its own memory address and size on the stack, whereas a reference shares the same memory address with the original variable. So it is safe to think of a reference as another name for the same variable. This difference is important, but I don’t think it is a reason when choosing references vs pointers.

Friday, September 6, 2013

函数式编程的另类指南(3)

http://blog.pengyifan.com/%e5%87%bd%e6%95%b0%e5%bc%8f%e7%bc%96%e7%a8%8b%e7%9a%84%e5%8f%a6%e7%b1%bb%e6%8c%87%e5%8d%973/

Thanksgiving day

函数式编程的另类指南(2)

http://blog.pengyifan.com/%e5%87%bd%e6%95%b0%e5%bc%8f%e7%bc%96%e7%a8%8b%e7%9a%84%e5%8f%a6%e7%b1%bb%e6%8c%87%e5%8d%972/

Thursday, September 5, 2013

When to use Comparable and Comparator?

By  | September 8, 2013

Programcreek demonstrates examples of using Comparable and Comparator. The next question will be when to use Comparable and Comparator. Here I list two basic rules (actually only the first one is really important):
  1. If there is a natural ordering of the object, then the class should implement Comparable, e.g., integers, strings (generally in the alphabet order), and points. On the other hand, if an object has multiple ways of ordering, then Comparator interface should be used to specify which way of sorting should take place. For example, HDTV in the Programcreek example can either be sorted by size or band name. In such case, Comparator is should be used. Another advantage is that Comparator can specify which parameter to be used for ordering. It then can be self descriptive. Hence, we can have SizeComparator and BandComparator for comparison, respectively.
  2. If you are not able to change the code of the object, which means you cannot implement Comparable, then Comparator is the only way left.
In summary, order of comparison is very important while implementing objects. Requirements may even change during implementing. For example, strings are generally compared alphabetically, but you may need to compare strings on their lengths as well. Therefore, designing of comparison needs to be very careful. In general, implement Comparable for natural order and write a Comparator for other needs.

Scale, Standardize, and Normalize data

http://blog.pengyifan.com/scale-standardize-and-normalize-data/

Wednesday, September 4, 2013

MathJax with Blogger

MathJax in blogger.com is useful when I need to input equation in my blog. This is a instruction and test of using MathJax in blogger.com.
  1. set blogger.com template to "Simple". "Dynamic Views" seems not working.
  2. edit HTML by adding the following code between <head> and </head>.
    <script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' type='text/javascript'/>
    
  3. type math equation in the blog.
Note that, enclosing math in single $'s does not work. Instead, I use "\(" and "\)" for inline math and "\[" and "\]" for displayed math. For example:
\(\frac{2}{3}\)
will show an inline math "\(\frac{2}{3}\)", and
\\[z=\sqrt{x^2+y^2}\\]
will show a displayed math \[z=\sqrt{x^2+y^2}\]

Monday, September 2, 2013

How to Read a Paper

S. Keshav, How to Read a Paper, ACM Computer Communication Review, July 2007.
In this 2-page paper, (Keshav, 2007) introduced a very practical and efficient three-pass method for reading research papers. He also described how to use this method to do a literature survey. S. Keshav is a professor in CS at the Univ of Waterloo. The above link points to the updated version of Aug 2, 2013.
Some sentences that I like:
If a reviewer cannot understand the gist after one pass, the paper will likely be rejected; if a reader cannot understand the highlights of the paper after five minutes, the paper will likely never be read. For these reasons, a ‘graphical abstract’ that summarizes a paper with a single well-chosen figure is an excellent idea and can be increasingly found in scientific journals.

SSH and Thunar


sshfs name@server:/path/to/folder /path/to/mount/point