XCSF
1.4.7
XCSF learning classifier system
|
Visualises a GP tree with graphviz. More...
Public Member Functions | |
None | __init__ (self, list[str] tree, str filename, str|None note=None, list[str]|None feature_names=None) |
str | label (self, str symbol) |
str | read_function (self) |
str | read_subexpr (self) |
Data Fields | |
gviz | |
None xcsf.utils.viz.TreeViz.__init__ | ( | self, | |
list[str] | tree, | ||
str | filename, | ||
str | None | note = None , |
||
list[str] | None | feature_names = None |
||
) |
Plots a tree with graphviz, saving to a file. Parameters ---------- tree : list[str] List of strings representing a GP tree. filename : str Name of the output file to save the drawn tree. note : str, optional Optional string to be added as a note/caption. feature_names : list[str], optional Optional list of feature names.
Definition at line 34 of file viz.py.
References GPTree.pos, and GPTree.tree.
str xcsf.utils.viz.TreeViz.label | ( | self, | |
str | symbol | ||
) |
Returns the node label for a symbol.
Definition at line 65 of file viz.py.
Referenced by xcsf.utils.viz.DGPViz.draw(), xcsf.utils.viz.TreeViz.read_function(), and xcsf.utils.viz.TreeViz.read_subexpr().
str xcsf.utils.viz.TreeViz.read_function | ( | self | ) |
Parses functions.
Definition at line 75 of file viz.py.
References xcsf.utils.viz.TreeViz.gviz, xcsf.utils.viz.DGPViz.gviz, xcsf.utils.viz.TreeViz.label(), xcsf.utils.viz.DGPViz.label(), GPTree.pos, xcsf.utils.viz.TreeViz.read_function(), xcsf.utils.viz.TreeViz.read_subexpr(), and GPTree.tree.
Referenced by xcsf.utils.viz.TreeViz.read_function(), and xcsf.utils.viz.TreeViz.read_subexpr().
str xcsf.utils.viz.TreeViz.read_subexpr | ( | self | ) |
Parses sub-expressions.
Definition at line 89 of file viz.py.
References xcsf.utils.viz.TreeViz.gviz, xcsf.utils.viz.DGPViz.gviz, xcsf.utils.viz.TreeViz.label(), xcsf.utils.viz.DGPViz.label(), GPTree.pos, xcsf.utils.viz.TreeViz.read_function(), and GPTree.tree.
Referenced by xcsf.utils.viz.TreeViz.read_function().
xcsf.utils.viz.TreeViz.gviz |
Definition at line 59 of file viz.py.
Referenced by xcsf.utils.viz.DGPViz.draw(), xcsf.utils.viz.TreeViz.read_function(), and xcsf.utils.viz.TreeViz.read_subexpr().