Skip to content

Implement SAITS time series imputation model#1

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-data-imputation-feature
Draft

Implement SAITS time series imputation model#1
Copilot wants to merge 3 commits intomainfrom
copilot/add-data-imputation-feature

Conversation

Copy link

Copilot AI commented Dec 1, 2025

Implements a complete SAITS (Self-Attention-based Imputation for Time Series) project for multivariate time series data imputation using a dual-branch self-attention architecture.

Changes

  • Model (saits/model.py): SAITS implementation with positional encoding, diagonal-masked self-attention, dual DMSA blocks, and combined ORT/MIT loss function
  • Data utilities (saits/data.py): TimeSeriesDataset with artificial masking, normalization, sliding windows, train/test split
  • Training (saits/train.py): SAITSTrainer with early stopping, LR scheduling, checkpointing
  • Evaluation (saits/evaluate.py): MAE, MSE, RMSE, MRE metrics for imputation quality
  • Tests: 36 tests covering model, data, and evaluation modules

Usage

from saits import SAITS, TimeSeriesDataset, SAITSTrainer

# Create model
model = SAITS(n_features=10, n_layers=2, d_model=128, n_heads=4)

# Impute missing values (mask: 1=observed, 0=missing)
x = torch.randn(32, 100, 10)
mask = torch.ones_like(x)
mask[:, 20:30, :5] = 0
imputed = model.impute(x, mask)
Original prompt

SAITS data imputation project


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 1, 2025
Copilot AI and others added 2 commits December 1, 2025 02:45
…training pipeline, and tests

Co-authored-by: fnfloresra <116979695+fnfloresra@users.noreply.github.com>
Co-authored-by: fnfloresra <116979695+fnfloresra@users.noreply.github.com>
Copilot AI changed the title [WIP] Add data imputation feature to SAITS project Implement SAITS time series imputation model Dec 1, 2025
Copilot AI requested a review from fnfloresra December 1, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants