Skip to content

Commit

Permalink
Doc: Fix some typos in model selection example (#1140)
Browse files Browse the repository at this point in the history
and remove unused imports.
  • Loading branch information
dweindl authored Oct 23, 2023
1 parent 74c526e commit 4fa37b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions doc/example/model_selection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"\n",
"| model_subspace_id | petab_yaml | $\\theta_1$ | $\\theta_2$ | $\\theta_3$ |\n",
"|:---------|:----------------------------------|:----|:----|:----|\n",
"| M1_0\t| example_modelSelection.yaml\t| 0\t | 0 |\t0 | \n",
"| M1_0\t| example_modelSelection.yaml\t| 0\t | 0 |\t0 |\n",
"| M1_1\t| example_modelSelection.yaml\t| 0\t | 0\t| estimate |\n",
"| M1_2\t| example_modelSelection.yaml\t| 0\t | estimate |\t0 |\n",
"| M1_3\t| example_modelSelection.yaml\t| estimate |\t0\t| 0 |\n",
Expand Down Expand Up @@ -249,7 +249,6 @@
"import pypesto.logging\n",
"\n",
"pypesto.logging.log(level=logging.WARNING, name=\"pypesto.petab\", console=True)\n",
"import petab\n",
"\n",
"pypesto_select_problem_1 = pypesto.select.Problem(\n",
" petab_select_problem=petab_select_problem\n",
Expand All @@ -260,7 +259,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Models can be selected with a model selection algorithm (here: [forward](https://en.wikipedia.org/wiki/Stepwise_regression)) and a comparison criterion (here: [AIC](https://en.wikipedia.org/wiki/Akaike_information_criterion)). The forward method start with the smallest model. Within each following iteration it tests all models with one additional estimated parameter.\n",
"Models can be selected with a model selection algorithm (here: [forward](https://en.wikipedia.org/wiki/Stepwise_regression)) and a comparison criterion (here: [AIC](https://en.wikipedia.org/wiki/Akaike_information_criterion)). The forward method starts with the smallest model. Within each following iteration it tests all models with one additional estimated parameter.\n",
"\n",
"To perform a single iteration, use `select` as shown below. Later in the notebook, `select_to_completion` is demonstrated, which performs multiple consecutive iterations automatically.\n",
"\n",
Expand Down Expand Up @@ -303,7 +302,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To search more of the model space, hence modls with more parameters, the algorithm can be repeated. As models with no estimated parameters have already been tested, subsequent `select` calls will begin with the next simplest model (in this case, models with exactly 1 estimated parameter, if they exist in the model space), and move on to more complex models.\n",
"To search more of the model space, hence models with more parameters, the algorithm can be repeated. As models with no estimated parameters have already been tested, subsequent `select` calls will begin with the next simplest model (in this case, models with exactly 1 estimated parameter, if they exist in the model space), and move on to more complex models.\n",
"\n",
"The best model from the first iteration is supplied as the predecessor (initial) model here."
]
Expand Down Expand Up @@ -443,8 +442,6 @@
}
],
"source": [
"from pprint import pprint\n",
"\n",
"import numpy as np\n",
"from petab_select import Model\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion pypesto/visualize/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def default_label_maker(model: Model) -> str:
def plot_selected_models(
selected_models: List[Model],
criterion: str = Criterion.AIC,
relative: str = True,
relative: bool = True,
fz: int = 14,
size: Tuple[float, float] = (5, 4),
labels: Dict[str, str] = None,
Expand Down

0 comments on commit 4fa37b4

Please sign in to comment.