Tuesday, February 15, 2011

Collapsing v. Deleting

I am in the midst of implementing my own CART decision tree and ran into a semantic snag. In Hastie's book, The Elements of Statistical Learning, it is stated that the best way to determine the size of the decision tree is to grow a large tree and then prune it afterwards.

In this process, internal nodes are "collapsed". It wasn't until I started implementing this that I realized I was not clear on what was meant by collapsing. Initially I thought it meant deleting a node from the tree, which is wrong.

I had to grab Brieman's original book, Classification and Regression Trees to find out what was meant, and feel a little foolish now knowing how simple the answer is. Collapsing a node simply means removing the entire subtree below, but not including, that node. -_____-

The book includes a nice diagram which I figure would be helpful for anyone whoever reads this. Basically the following is a demonstration of collapsing the tree at node T2, i.e., T-T2.

Wednesday, November 24, 2010

Words of WIsdom

I am nearing the end of my machine learning coarse and felt it was time to share different quotes my professor has said throughout the quarter. They are both deep and provacative:


1. [Said very dramatically] "You can't get around the noise!"

2. "There are worse things than gradient descent to take on faith."

3. "Son, you need to avoid gradient descent algorithms."

4. "There is a good chance today's lecture won't come out well."

5. "They're sexy because they have the word neural in them."

6. "Why do math classes take so long?"

7. "And how do you do that? Don't worry. It's just math, you don't have to implement it."

8. "It doesn't really exist but that isn't going to stop us from writing it down."

9. "It's about exactly approximate to it, not approximately approximate to it."

10. "Now I want to show you a picture. Why? Because I like this picture. It makes me happy."

Friday, November 19, 2010

Android - Live Wallpapers

I have decided to waste my time noodling with developing a live wallpaper for Android. Here's where I am at.

1. ADK downloaded and working. This process can really only be described as delightful. I cannot believe how easy it was.

2. Get the samples. The ADK comes with a number of examples that can be downloaded through eclipse. Window -> Android SDK and AVD Manager -> Available Packages -> Download all that noize. Everything that gets downloaded into wherever you unzipped the ADK tarball. In that directory there should now be a samples directory filled with all kinds of goodies.

3. Run sample live wallpaper. File -> New -> Project -> Android -> Android Project -> Next. Select the "Create project from existing source" radio button. Browse -> /samples/android-8/CubeLiveWallpaper. Finish.

4. Right click the project that appears -> Run as -> Android Application.

5. Under Live Wallpapers on the emulator, the cube examples will now be available.

6. Collect the cash.

Making my own wallpaper is now as easy as modifying the template that has been provided. The next step is to figure out what the heck I want the wallpaper to do.