Repository navigation
feat(drift): implement semi-synthetic drift generation via dataset splicing (Shaker protocol) - #17
Merged
Conversation
MichalRedm
force-pushed
the
feat/11-semi-synthetic-drift-shaker-protocol
branch
from
October 7, 2026 13:43
31d74be to
2e7f804
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
FeatureMatchersupporting exact column matching, manual mapping dictionary, statistical distribution matching (Wasserstein distance with optimal bipartite assignment viascipy.optimize.linear_sum_assignment), shared PCA latent subspace projection, and distribution normalization (StandardScaler/MinMaxScaler, joint or per-concept).DriftBlendersupporting abrupt, gradual (Shaker sigmoidal Bernoulli trials), incremental (nearest-neighbor linear interpolation), and recurring (harmonic periodic oscillation) drift schedules with fullrandom_statereproducibility.SemiSyntheticDriftDatasetadhering strictly toBaseDataset, carrying ground-truth change-point timestamps, transition intervals, binary concept indicators, and drifting feature diagnostics.DatasetRegistryto persist and reload semi-synthetic dataset recipes inregistry.jsonand serialize static streams.open_dataset_stitcher_modal()in Streamlit dashboard allowing concept selection, feature mapping, schedule configuration, transition curve preview, and direct registration.tests/test_semi_synthetic_drift.py).Motivation
Resolves #11.
Key Changes
1. Core Algorithmic Library (
src/stride/datasets/)feature_matching.py:FeatureMatcheraligning heterogeneous datasets with distribution diagnostics and KS/Wasserstein drifting feature discovery.drift_blending.py:DriftBlendermanaging transition mechanics (abrupt, sigmoidal gradual, nearest-neighbor incremental, harmonic recurring).semi_synthetic.py:SemiSyntheticDriftDatasetproviding(X, y)stream generation with ground-truth metadata properties.benchmarks.py: Replicates canonical empirical benchmarks (UCI Wine Quality Red vs. White).dataset_registry.py: Extends registry to support semi-synthetic recipes and CSV persistence.src/stride/datasets/__init__.pyand top-levelsrc/stride/__init__.py.2. Streamlit Dashboard Integration (
dashboard/)dataset_stitcher.py: 4-tab modal dialog for interactive dataset splicing, alignment, transition scheduling, and registration.sidebar.py: Integrated"🔀 Stitch Datasets (Semi-Synthetic Drift)..."into dataset selector.app.py: Tracks active dataset ground-truth metadata in session state and propagates to downstream tabs.drift_detection.py: Plots ground-truth change points and transition regions; displays detection delay metrics.feature_importance_analysis.py: Displays ground-truth drifting features banner for comparison with SHAP/Permutation shifts.3. Empirical Benchmark Validation: UCI Wine Quality (Red$\to$ White)
4. Verification & Context Maintenance
tests/test_semi_synthetic_drift.pycovering matching, blending, dataset contracts, and benchmark replication..agents/context/architecture.mdand.agents/project_context.md.Verification
ruff check .passed with 0 errorsruff format --check .passed cleanly (112 files formatted)python -m unittest discover testspassed with 42/42 tests passing in 15.3s