Plotting Module

class AssetPriceMovementSummaryPlotResponsibilityChain

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for asset price movement summary plots. It implements the _can_plot and _plot methods to visualize asset price movements and volatility over time.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class ClassificationTestingPlotResponsibilityChain

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for classification testing results. It implements the _can_plot and _plot methods to visualize confusion matrices, classification reports, and ROC curves.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class ClassificationTrainingPlotResponsibilityChain

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for classification training results. It implements the _can_plot and _plot methods to visualize training loss and accuracy.

class PlottingMode(value)

Bases: Enum

Enumeration for the different plotting modes. It defines the modes for TensorFlow and Scikit-learn models.

SKLEARN = 'sklearn'
TF = 'tensorflow'
UNSUPPORTED = 'unsupported'

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class PerformanceTestingPlotResponsibilityChain(window_size: int = 5)

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for performance testing results. It implements the _can_plot and _plot methods to visualize assets values, currency prices, and solvency coefficients over time.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class PlotResponsibilityChainBase

Bases: ABC

Base class for implementing the responsibility chain pattern for plotting.

This class provides a framework for creating a chain of plotting handlers where each handler can decide whether it can handle a specific plot request. If a handler cannot process the request, it passes the request to the next handler in the chain. All plotting chain implementations should inherit from this class and implement the _can_plot and _plot methods.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class PriceMovementTrendClassSummaryPlotResponsibilityChain

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for price movement trend classification results.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]

class ReinforcementTrainingPlotResponsibilityChain(window_size: int = 5)

Bases: PlotResponsibilityChainBase

Implements a plotting responsibility chain for reinforcement learning training results. It implements the _can_plot and _plot methods to visualize training history.

Adds the next handler to the responsibility chain.

Parameters:

next_chain_link (PlotResponsibilityChainBase) – The next handler to process requests if this handler cannot.

plot(data) Optional[Axes]

Attempts to plot data by finding an appropriate handler in the chain.

Parameters:

data (dict) – Dictionary containing ‘key’ identifying the plot type and ‘plot_data’ containing the actual data to be plotted.

Returns:

The matplotlib Axes object if plotting was successful,

None if no handler in the chain could process the request.

Return type:

Optional[plt.Axes]