Adding Markov Model #5
Closed
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 #4
This pull request introduces a Markov model to simulate household load timestamps, along with significant updates to the codebase for preprocessing, transition matrix computation, and visualization. The most important changes include adding bucketing functionality, implementing parallelized transition matrix computation, and enhancing plotting capabilities for transition matrices.
Markov Model Enhancements
CHANGELOG.md
file.Preprocessing Updates
Bucket
class and theadd_bucket_columns
function insrc/preprocessing/bucketing.py
to classify timestamps into buckets based on month, weekend/weekday, and quarter-hour intervals. This enables efficient grouping for Markov model computations.Transition Matrix Computation
build_transition_matrices_parallel
function insrc/markov/transmats.py
to compute transition matrices for each bucket in parallel, improving performance for large datasets. It also includes Laplace smoothing for probability calculations.Visualization Enhancements
plot_transition_matrix
function insrc/markov/plothelper.py
to visualize transition matrices with detailed titles and color-coded probabilities. This aids in understanding the transitions between states.Main Script Updates
src/main.py
: Updated the main script to load and preprocess data, compute transition matrices, save results, and visualize selected matrices using the new functionalities. [1] [2]