hrossman / pymsm Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
๐ Hi folks, I'm the reviewer for your JOSS submission. I'll be making issues in this repo for my feedback.
pull_request
and push
. Contributors will push to the main branch, and you want CI to run for these commits, too.pip3 install -e .
, and the py.test
to test. That can be documented in a section on the README or the docs.test_msm_examples.py
and test_sim.py
should assert some output. There should be a reason you are running a test - assert that.src/pymsm/datasets/__init__.py:319
/Users/camerondavidson-pilon/code/pymsm/src/pymsm/datasets/__init__.py:319: DeprecationWarning: invalid escape sequence \R
1: "Discharged\Recovered",
stepfunc
seems like an important function, but has lots of potential edge cases. This would be a good function to test as well.From the checklist:
Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support
Typically project authors will include a CONTRIBUTING.md with this information.
Costume
-> Custom
Dear all,
Thanks for making this package available.
While running a Montecarlo simulation with model.run_monte_carlo_simultion
, I found that the output trajectories are either unsorted or the times represents the time between events.
As an example:
simulated_paths = model.run_monte_carlo_simulation(
sample_covariates=covariates,
origin_state=0,
current_time=0,
n_random_samples=100,
max_transitions=3,
n_jobs=5,
print_paths=True,
)
the outcome is
States: [3, 4, 6]
Transition times: [28.000029122914018, 912.999970877086, 1451.0]
States: [3, 6]
Transition times: [32.000013949386066, 2359.999986050614]
States: [3, 4, 1]
Transition times: [26.000044015249372, 425.9999559847506, 366.0]
in the last of the path reported above, last time_at_each_state
is lower than the preceding (
Does this imply:
path.states
are unsorted and need to be sorted according to path.time_at_each_state
;path.time_at_each_state
represent the time between states, hence we need to compute the cumulative time ourselves.Finally I'm doubting about the structure of the input date for Pathobject
: in states
I read:
States visited (encoded as positive integers, 0 is saved for censoring), in the order visited. Defaults to None.
hence I suppose that time_at_each_state
should also be ordered but maybe it should be a time difference between states?
Some of these are easy tasks, some are just suggestions to provide better docs.
.svg
image, but should point to the action (ex: https://github.com/hrossman/pymsm/actions/workflows/tests.yml instead of https://github.com/hrossman/pymsm/actions/workflows/tests.yml/badge.svg)Overall, I like your docs! I would like more emphasis on educating newbies. Y'all are experts, teach me!
I have prepared a pandas dataframe according to the documentation https://hrossman.github.io/pymsm/usage/Preparing_a_dataset/#preparing-a-dataset-for-multistate-modeling-with-pymsm but I receive this error message when I try to fit the model:
from pymsm.multi_state_competing_risks_model import MultiStateModel
multi_state_model = MultiStateModel(
dataset=dfML,
covariate_names=covariate_cols,
terminal_states=terminal_states)
AttributeError Traceback (most recent call last)
Cell In[64], line 3
1 # Init MultistateModel
2 from pymsm.multi_state_competing_risks_model import MultiStateModel
----> 3 multi_state_model = MultiStateModel(
4 dataset=dfML,
5 covariate_names=covariate_cols,
6 terminal_states=terminal_states)
File ~\AppData\Roaming\Python\Python311\site-packages\pymsm\multi_state_competing_risks_model.py:127, in MultiStateModel.init(self, dataset, terminal_states, update_covariates_fn, covariate_names, event_specific_fitter, competing_risk_data_format, state_labels, trim_transitions_threshold)
125 self._trim_transitions()
126 else:
--> 127 self._assert_valid_input()
File ~\AppData\Roaming\Python\Python311\site-packages\pymsm\multi_state_competing_risks_model.py:156, in MultiStateModel._assert_valid_input(self)
154 # Check the number of times is either equal or one less than the number of states
155 for obj in self.dataset:
--> 156 n_states = len(obj.states)
157 n_times = len(obj.time_at_each_state)
158 assert n_states == n_times or n_states == n_times + 1
AttributeError: 'str' object has no attribute 'states'
Dear Sir/Madam,
I am confused by the denifition of time_entry_to_origin and time_transition_to_target in some of your examples, especially time_transition_to_target. It seems that time_entry_to_origin can be the the time difference between target state and baseline.
Is time_transition_to_target the time difference between target state and origin state OR the time difference between target state and baseline?
Hi! I am one of the reviewers for your JOSS paper. I will be adding comments as issues in the next hours/days.
I tried following the links to the full examples on the README but they are dead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.