-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TSI score code #1166
Add TSI score code #1166
Conversation
What do you think, @michalk8? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1166 +/- ##
==========================================
+ Coverage 80.55% 80.69% +0.13%
==========================================
Files 51 51
Lines 8496 8566 +70
Branches 2221 2234 +13
==========================================
+ Hits 6844 6912 +68
+ Misses 1107 1102 -5
- Partials 545 552 +7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please add tests.
Adds function for computing terminal state identification.
Add class method to compute TSI score.
Add class method to plot terminal state identification.
* Iterate through macrostates in decreasing order to compute Schur decomposition only once. * Access macrostates via attribute `macrostates`. * Allow passing keyword arguments to `compute_macrostates`. * Simplify value assignment for an optimal identification. * Update docstrings
* Update default values of `x_offset` and `y_offset` and update type hints. * Rename argument `fname` to `save`. * Add arguments `figsize` and `dpi`. * Update docstrings. * Update figure setup. * Fix x-axis labels caused by latest changes to `get_tsi`. * Use `save_fig` function. * Return matplotlib `Figure` and `Axis` instances.
@michalk8, can you have another look, please? Once the code is fine, I'll add unit tests. |
Rename columns from "Number of macrostates" to "number_of_macrostates", "Identified terminal states" to "identified_terminal_states", "Optimal identification" to "optimal identification".
Update column names in plotting DataFrame from "Method" to "method".
Rename attribute to `_tsi` and define it in `__init__`.
* Rename method to `tsi`. * Refactor `tsi` to return TSI score. * TSI is only computed if it has not been computed before, the number of macrostates is larger than previously considered, a new set of terminal states or cluster key is used.
* Add argument `n_macrostates`. * Remove argument `tsi_df` and use class attribute directly instead.
* Update docs.
* Update docstrings. * Update `RuntimeError` message * Update return statement; only `ax` is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @WeilerP !
Save `terminal_states` in `uns` slot of `tsi` attribute as list.
@michalk8, do you happen to know why some plotting tests fail after I've added the unit tests? |
New
GPCCA::get_tsi
to compute terminal state identification (TSI).GPPCA::get_tsi_score
to compute TSI score.GPCCA::plot_tsi
to visualize TSI.Closes
Closes #1165.