Added full Markov-model pipeline #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10
This pull request introduces a comprehensive implementation of a Markov-model pipeline for analyzing time-series data, including preprocessing, transition matrix generation, and testing. The most significant changes include adding the Markov-model pipeline to the project, implementing bucket-based time mapping, and updating the loader and tests to integrate the new functionality.
Markov-model pipeline implementation:
CHANGELOG.md
, CHANGELOG.mdR11)src/markov/transition_counts.py
andsrc/markov/transitions.py
for generating raw transition counts and Laplace-smoothed transition probabilities, respectively. [1] [2]Time-bucket mapping:
src/markov/buckets.py
, which maps timestamps to unique bucket IDs based on month, weekend flag, and quarter-hour intervals. (NUM_BUCKETS
constant andbucket_id
function)load_timeseries
function to add a "bucket" column. [1] [2]Refactoring and modularization:
src/markov
package with an__init__.py
file for better organization and reusability._core.py
to encapsulate shared Markov-model logic, such as the_transition_counts
function.Testing and validation:
tests/test_loader.py
to validate the integration of the Markov-model pipeline, ensuring the loader correctly adds "state" and "bucket" columns and computes expected values.Miscellaneous:
src/main.py
andsrc/markov/model.py
. [1] [2]