# Neural Oblivious Decision Ensembles for Deep Learning on Tabular Data
## Reference
https://arxiv.org/pdf/1909.06312.pdf
## Outline
![](https://i.imgur.com/DEm01DV.png)
## Random Forest
アンサンブル学習(Ensemble Learning)の有名なアルゴリズムにランダムフォレスト(Random Forest)がある。
アンサンブル学習は弱学習機(決定木やLogisticRegression等)を複数組み合わせてモデル化する。
### Training
訓練データからn%のデータ量とf%の特徴量をブートストラップサンプリング(重複ありのランダムサンプル)して、そのsub sample 毎に弱学習機(ランダムフォレストでは決定木)を作成する。
![](https://i.imgur.com/ZPJ8yrE.png)
### Prediction
![](https://i.imgur.com/rPzK5Qc.png)
## DecisionTree -> NN
前回の構造から少し変更(メモリ節約の観点と予想)。
前回は以下。Leaf node の経路を表現するのに、通常の決定木同様、$2^{depth}-1$個のnodeが必要だった。
![](https://i.imgur.com/Km6y3wk.png)
==今回扱う決定木==は以下。Leaf node までの経路を$depth$のnode数で表現する。
![](https://i.imgur.com/WrGQ8XO.png)
下図は論文の絵。同一の深さで同一の関数$F_i$が適用されている点に注意。
$F_i$のinput nodeは特徴量の数、出力は1次元である。
![](https://i.imgur.com/tc3ySSq.png)
### Feature selection
Entmax(https://github.com/deep-spin/entmax)※Softmax の改良版※を使って、Feature Selection を行い、その重みも学習で獲得する。
![](https://i.imgur.com/lq4OWaq.png)
Entmax
![](https://i.imgur.com/HCqKYWQ.png)
```python
In [1]: import torch
In [2]: from torch.nn.functional import softmax
In [2]: from entmax import sparsemax, entmax15, entmax_bisect
In [4]: x = torch.tensor([-2, 0, 0.5])
In [5]: softmax(x, dim=0)
Out[5]: tensor([0.0486, 0.3592, 0.5922])
In [6]: sparsemax(x, dim=0)
Out[6]: tensor([0.0000, 0.2500, 0.7500])
In [7]: entmax15(x, dim=0)
Out[7]: tensor([0.0000, 0.3260, 0.6740])
```
## RandomForest -> NN
下記は論文の絵。
![](https://i.imgur.com/IYIHzfI.png)
TreeやLayerへの入出力など。各Layer毎がRandomForestのようなバギングアンサンブル、Layerに渡ってはboosting のイメージ。
![](https://i.imgur.com/B8ZXYHy.png)