Grouper/Cuttlefish — pull request #8 by cjlwired (2013-12-15 01:06:58+00:00)
Title: ID3 / Neural Network Cuttlefish Solution in Ruby

**Cuttlefish Challenge**

```
,r-‐、　　　　　　　　　　　　　 r､_	The Grouper Social Club
／　 .ハ 　 　 __　　　　　　　　　 ）.　｀ヽ	Cuttlefish Challenge
. i' 　　/　弋‐r-´- ﾐ､___　　　　　 ノ :. 　 　i,	Soln By: Carlos Lazo
. 'i,　 /.　　 ヽl　_,-= _`ヽﾐー--‐''´　 ;　　　 i,
ヽｲ　　　　' ,　,r=＝ニ､,ヽ、 　 　.:;　　　　|
i,　　　　　;　__ ,r‐'´-‐ﾆヽ、　; 　 　 　 l
.　　　i, 　　　　 ';.　‐-､´r'´-‐=ﾆヽ、　　　　i
. 　 　ヽ　　　　　';.　-‐´-　-ニ-_=.ヽ、　　 ﾉ
ヽ、　　　　;:　´ ,r ,.--‐ﾆニ'｀_ヽ、 /
ヽ､,　　　 ':;.　 ,-'r' ,-‐‐=｀‐-､X、
｀ヽ､,_　 ' :;..　　　　_,,r- ‐ ‐-､' _
｀`'ー‐-､　 .i',ri,､　 ,r‐-､ ヽ、
｀ヽｨ七ﾌ) ´　 ､ヽ　｀ヽ､
｀ヾﾞ,　｀ 、ヽヾ i,ヽ ｀ヽ、
i,　', ｀、.＼',.i, ｀ヽ、ヽ、
i、｀､ ';, 　ヽ ', i,. ヽ,　'!
ヽ、ヾ,ヽ　 i!.ﾐ ',　'i　|
｀ヽ､ '､　.'ii!）l .ﾘ ﾉ
｀ ﾐ､ i,l,i,',.{y
ヽ､ﾘ'゛､j

```

I decided to tackle this problem via `Ruby` and looked at two different approaches using the `ai4r` gem:
- [Decision Tree](http://en.wikipedia.org/wiki/Decision_tree) (**DT**) via [ID3 Algorithm](http://en.wikipedia.org/wiki/ID3_algorithm)
- [Neural Network](http://en.wikipedia.org/wiki/Artificial_neural_network) (**NN**) via [Backward Propagation](http://en.wikipedia.org/wiki/Backpropagation)

Implementation detail can be seen by [checking out || cloning] my repo, located [HERE](https://github.com/cjlwired/Cuttlefish/).

---

A quick comparison of both algorithms' respective outputs showed the following:

Algorithm | # TRUE | # FALSE
:-----------: | :-----------: | :-----------:
DT | 224 | 275
NN | 272 | 227

==> Row Matches b/w Algorithms = 269 / 499
==> Rows True in both Algorithms = 133 / 499

A few assumptions I made in my analysis:

* DT algorithm decision tree built on data as received initially.
* All columns for NN algorithm were normalized to scale of [0.0, 1.0].
* All weighting criterion was computed by algorithm.
* Did not get a chance to optimize NN learning parameters / training curve.

The solution I chose to submit is that for the **Decision Tree**.
Why? Was looking at my :christmas_tree: at the time of this submission.

---

Did my best to adhere to your [Ruby Style Guide](https://github.com/Grouper/ruby-style-guide#classes--modules)!
Thanks for setting up this awesome challenge.

Carlos