Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -202,17 +202,29 @@ def show_descriptions():
|
|
| 202 |
# π¬ Risk Matrix
|
| 203 |
def generate_risk_matrix():
|
| 204 |
names = list(strategy_presets.keys())
|
| 205 |
-
scores = {
|
| 206 |
-
|
|
|
|
|
|
|
| 207 |
matrix = np.zeros((len(names), len(names)))
|
| 208 |
for i, a in enumerate(names):
|
| 209 |
for j, b in enumerate(names):
|
| 210 |
matrix[i, j] = abs(scores[a] - scores[b])
|
| 211 |
-
fig = px.imshow(
|
| 212 |
-
|
| 213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
return fig
|
| 215 |
|
|
|
|
| 216 |
# π App UI
|
| 217 |
app = gr.TabbedInterface(
|
| 218 |
interface_list=[
|
|
|
|
| 202 |
# π¬ Risk Matrix
|
| 203 |
def generate_risk_matrix():
|
| 204 |
names = list(strategy_presets.keys())
|
| 205 |
+
scores = {
|
| 206 |
+
name: simulate_tp_strategy_full(**{k: v for k, v in cfg.items() if k != "description"})[1]["EdgeCast Score"]
|
| 207 |
+
for name, cfg in strategy_presets.items()
|
| 208 |
+
}
|
| 209 |
matrix = np.zeros((len(names), len(names)))
|
| 210 |
for i, a in enumerate(names):
|
| 211 |
for j, b in enumerate(names):
|
| 212 |
matrix[i, j] = abs(scores[a] - scores[b])
|
| 213 |
+
fig = px.imshow(
|
| 214 |
+
matrix,
|
| 215 |
+
x=names,
|
| 216 |
+
y=names,
|
| 217 |
+
text_auto=".2f", # π© Cell values displayed
|
| 218 |
+
color_continuous_scale="RdYlGn_r",
|
| 219 |
+
labels={"color": "Score Ξ"},
|
| 220 |
+
title="π§ Risk Matrix (Ξ Score Heatmap)"
|
| 221 |
+
)
|
| 222 |
+
fig.update_traces(
|
| 223 |
+
hovertemplate="<b>%{y}</b> vs <b>%{x}</b><br>Ξ Score: %{z:.2f}<extra></extra>"
|
| 224 |
+
)
|
| 225 |
return fig
|
| 226 |
|
| 227 |
+
|
| 228 |
# π App UI
|
| 229 |
app = gr.TabbedInterface(
|
| 230 |
interface_list=[
|