# Neural Oblivious Decision Ensembles for Deep Learning on Tabular Data
## Reference
https://arxiv.org/pdf/1909.06312.pdf
## Outline

## Random Forest
アンサンブル学習(Ensemble Learning)の有名なアルゴリズムにランダムフォレスト(Random Forest)がある。
アンサンブル学習は弱学習機(決定木やLogisticRegression等)を複数組み合わせてモデル化する。
### Training
訓練データからn%のデータ量とf%の特徴量をブートストラップサンプリング(重複ありのランダムサンプル)して、そのsub sample 毎に弱学習機(ランダムフォレストでは決定木)を作成する。

### Prediction

## DecisionTree -> NN
前回の構造から少し変更(メモリ節約の観点と予想)。
前回は以下。Leaf node の経路を表現するのに、通常の決定木同様、$2^{depth}-1$個のnodeが必要だった。

==今回扱う決定木==は以下。Leaf node までの経路を$depth$のnode数で表現する。

下図は論文の絵。同一の深さで同一の関数$F_i$が適用されている点に注意。
$F_i$のinput nodeは特徴量の数、出力は1次元である。

### Feature selection
Entmax(https://github.com/deep-spin/entmax)※Softmax の改良版※を使って、Feature Selection を行い、その重みも学習で獲得する。

Entmax

```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
下記は論文の絵。

TreeやLayerへの入出力など。各Layer毎がRandomForestのようなバギングアンサンブル、Layerに渡ってはboosting のイメージ。
