Skip to content

Instantly share code, notes, and snippets.

View jonashoechst's full-sized avatar

Jonas Höchst jonashoechst

View GitHub Profile
@jonashoechst
jonashoechst / decision_tree_code_gen.py
Created September 14, 2017 14:05 — forked from ubershmekel/decision_tree_code_gen.py
Generate python code from orange-canvas decision trees
"""
How to use:
1. Place a "Python Script" node on your canvas
2. Hook your "Classification Tree" node out into the "Python Script" input
3. Paste this gist in the python script and hit "Execute"
The output should be similar to this:
# slope (<32.000, 34.000>)
if slope <=1.008: return False #(<7.000, 0.000>)