contango.trading.analysis.graphing.pairwise_heatmap_grid
contango.trading.analysis.graphing.pairwise_heatmap_grid
PairwiseHeatmapGrid
PairwiseHeatmapGrid(config: C)
Bases: GraphType[PairwiseHeatmapGridConfig]
A graph type that shows a grid of 2D heatmaps, one panel per facet value.
Source code in src\contango\trading\analysis\graph_type.py
26 27 28 29 30 31 32 33 | |
build
build(df: DataFrame) -> go.Figure
Builds a grid of 2D heatmaps: param_x vs. param_y, one panel per unique value of facet_param.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The experiment DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
Figure
|
A plotly Figure with one subplot per facet_param value. |
Source code in src\contango\trading\analysis\graphing\pairwise_heatmap_grid.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
PairwiseHeatmapGridConfig
dataclass
PairwiseHeatmapGridConfig(param_x: str, param_y: str, facet_param: str, target_metric: str = 'calmar_ratio', max_cols: int = 4)
Bases: GraphConfig
A graph configuration specific to the pairwise heatmap grid graph.
Attributes:
| Name | Type | Description |
|---|---|---|
param_x |
str
|
The parameter column for the heatmap x-axis. |
param_y |
str
|
The parameter column for the heatmap y-axis. |
facet_param |
str
|
The parameter column to facet panels by. |
target_metric |
str
|
The name for the targeted metric used for cell color. |
max_cols |
int
|
The maximum amount of panels per row before wrapping. |