YouTube-Blog icon indicating copy to clipboard operation
YouTube-Blog copied to clipboard

Update decision tree ensemble notebook to not use exec

Open teastburn opened this issue 2 years ago • 1 comments

Why

I appreciated the youtube series and wanted to give back with my expertise!

What

This code doesn't need exec, and exec and eval are considered anti-patterns, with some security implications. Particularly in a shared repo where the assumption is "trust me to run this code".

https://stackoverflow.com/questions/1933451/why-should-exec-and-eval-be-avoided

Tested

I tested it by running it in a Jupyter notebook in Pycharm and verifying the outputs by my eye. Certainly not the most foolproof testing method.

teastburn avatar Dec 23 '23 00:12 teastburn

Thanks for refactoring this @teastburn! Since the video and blog review the original example code, I want to preserve it.

However, your version is also helpful. Would you mind making another request where your version is a separate file named "tree_ensemble_example-no_exec.ipynb"?

ShawhinT avatar Dec 23 '23 16:12 ShawhinT