rmnldwg / lymph

Python package for statistical modelling of lymphatic metastatic spread in head & neck cancer.
https://lymph-model.readthedocs.io
MIT License
5 stars 4 forks source link

assign spread parameters by keyword #46

Closed rmnldwg closed 10 months ago

rmnldwg commented 1 year ago

Right now, it is sometimes confusing to assign the correct parameters, because they are simply passed in one - sometimes rather long - list to the model. It would be great to have a system of assigning spread parameters by keyword.

For example, if we had a method assign_parameters in the Unilateral class, we could allow setting parameters like this:

model.assign_parameters(spread_T_to_III=0.45, growth=0.82)

The names of the keywords could be auto-computed from the names of the tumor and the LNLs. In this example, the tumor would be called T and one of the LNLs III. Hence, the keyword to assign to the Edge instance between the two respective Node instances would be called spread_T_to_III.

This has several advantages:

  1. It avoids confusion and is more readable.
  2. One could easily set single parameters without the need to pass an entire array.
  3. The emcee package has a couple of quality-of-life features that we can use if parameters are assigned by keyword.
YoelPH commented 1 year ago

Is this solved by set_state_by_lnl? Or do you wan a different function that takes care of this task. Right now the parameters are still set by a modified check_and_assign function

Edit: sorry for the wrong interpretation

rmnldwg commented 1 year ago

No, we basically need a function similar to set_state_by_lnl, but instead of assigning states to nodes, it would assign spread probabilities to edges.