Dungeons and Dragons

dnd-dragons.jpg

Data for demo

Back to the spell book

1. Load Data

1.1 Libraries

1.2 Data

Training-Validation Split

3. Decision Tree

3.1 Large tree

Plot the tree

Export the top levels for illustration using max_depth. Export the whole tree if max_depth is excluded.

Plot the top 5 levels for illustration using max_depth. Plot the whole tree if max_depth is excluded.

Export tree and convert to a picture file.

Not very useful.

full_tree.png

3.2 Small Tree

Plot the tree

Export the top levels for illustration using max_depth. Export the whole tree if max_depth is excluded.

Plot the top 5 levels for illustration using max_depth. Plot the whole tree if max_depth is excluded.

Export tree and convert to a picture file.

Much better.

small_tree.png

3.3 Predictions Using the Small Tree

On the training set

Get the RMSE for the training set

If using the dmba package, install it first:

pip install dmba

On the validation set

Get the RMSE for the validation set

If using the dmba package, install it first:

pip install dmba

Then load the library

import dmba

from dmba import regressionSummary

4. Exhaustive Search

4.1 Best Tree

Online Conversion

best_tree.png

4.2 Predictions Using the Best Tree

On the training set

Get the RMSE for the training set

On the validation set

Get the RMSE for the validation set

5. New Records

New records

Using the small tree

Using the best tree

d20.jpeg