|
100 | 100 | "## Model selection\n", |
101 | 101 | "\n", |
102 | 102 | "To perform model selection, we define three methods to:\n", |
| 103 | + "\n", |
103 | 104 | "1. calibrate a single model\n", |
104 | 105 | "\n", |
105 | | - "This is where we convert a PEtab Select model into a statsmodels model, fit the model with statsmodels, then save the log-likelihood value in the PEtab Select model.\n", |
| 106 | + " This is where we convert a PEtab Select model into a statsmodels model, fit the model with statsmodels, then save the log-likelihood value in the PEtab Select model.\n", |
106 | 107 | "\n", |
107 | 108 | "2. perform a single iteration of a model selection method involving calibration of multiple models\n", |
108 | 109 | "\n", |
109 | | - "This is generic code that executes the required PEtab Select commands.\n", |
| 110 | + " This is generic code that executes the required PEtab Select commands.\n", |
110 | 111 | "\n", |
111 | 112 | "3. perform a full model selection run, involving all iterations of a model selection method\n", |
112 | 113 | "\n", |
113 | | - "This loads the PEtab Select problem from disk and performs all iterations of a model selection method.\n", |
| 114 | + " This loads the PEtab Select problem from disk and performs all iterations of a model selection method.\n", |
114 | 115 | "\n", |
115 | 116 | "In this case, the PEtab Select problem is setup to perform backward selection. See the files in `other_model_types_problem/petab_select`." |
116 | 117 | ] |
|
259 | 260 | "outputs": [], |
260 | 261 | "source": [ |
261 | 262 | "# Plot the history of model selection iterations.\n", |
| 263 | + "import matplotlib.pyplot as plt\n", |
262 | 264 | "\n", |
263 | 265 | "draw_networkx_kwargs = {\n", |
264 | 266 | " \"arrowstyle\": \"-|>\",\n", |
265 | 267 | " \"node_shape\": \"s\",\n", |
266 | | - " \"node_size\": 1000,\n", |
267 | 268 | " \"edgecolors\": \"k\",\n", |
268 | 269 | "}\n", |
| 270 | + "fig, ax = plt.subplots(figsize=(20, 20))\n", |
269 | 271 | "petab_select.plot.graph_iteration_layers(\n", |
270 | | - " plot_data=plot_data, draw_networkx_kwargs=draw_networkx_kwargs\n", |
| 272 | + " plot_data=plot_data,\n", |
| 273 | + " draw_networkx_kwargs=draw_networkx_kwargs,\n", |
| 274 | + " ax=ax,\n", |
271 | 275 | ");" |
272 | 276 | ] |
273 | 277 | } |
|
0 commit comments