XCSF  1.4.7
XCSF learning classifier system
xcsf.utils.viz.DGPViz Class Reference

Visualises a DGP graph with graphviz. More...

Public Member Functions

None __init__ (self, dict graph, str filename, str|None note=None, list[str]|None feature_names=None)
 
str label (self, str symbol)
 
None draw (self)
 

Data Fields

 gviz
 

Detailed Description

Visualises a DGP graph with graphviz.

Definition at line 102 of file viz.py.

Constructor & Destructor Documentation

◆ __init__()

None xcsf.utils.viz.DGPViz.__init__ (   self,
dict  graph,
str  filename,
str | None   note = None,
list[str] | None   feature_names = None 
)
Plots a DGP graph with graphviz, saving to a file.

Parameters
----------
graph : dict
    Dictionary representing a DGP graph.
filename : str
    Name of the output file to save the drawn graph.
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 105 of file viz.py.

References Graph.connectivity, ArgsDGP.n, Graph.n, PredNLMS.n, PredRLS.n, ArgsDGP.n_inputs, Graph.n_inputs, ArgsGPTree.n_inputs, Net.n_inputs, Layer.n_inputs, and ArgsLayer.n_inputs.

Member Function Documentation

◆ draw()

None xcsf.utils.viz.DGPViz.draw (   self)
Plots the nodes and edges in the graph.

Definition at line 151 of file viz.py.

References Graph.connectivity, xcsf.utils.viz.TreeViz.gviz, xcsf.utils.viz.DGPViz.gviz, xcsf.utils.viz.TreeViz.label(), xcsf.utils.viz.DGPViz.label(), ArgsDGP.n, Graph.n, PredNLMS.n, PredRLS.n, ArgsDGP.n_inputs, Graph.n_inputs, ArgsGPTree.n_inputs, Net.n_inputs, Layer.n_inputs, and ArgsLayer.n_inputs.

Here is the call graph for this function:

◆ label()

str xcsf.utils.viz.DGPViz.label (   self,
str  symbol 
)
Returns the node label for a symbol.

Definition at line 141 of file viz.py.

Referenced by xcsf.utils.viz.DGPViz.draw(), xcsf.utils.viz.TreeViz.read_function(), and xcsf.utils.viz.TreeViz.read_subexpr().

Here is the caller graph for this function:

Field Documentation

◆ gviz

xcsf.utils.viz.DGPViz.gviz

The documentation for this class was generated from the following file: