An open API service indexing awesome lists of open source software.

https://github.com/pointer2alvee/mlp-timeseries-interpolation-extrapolation

A bivariate timeseries dataset cleaned, interpolated & extrapolated using MLP, Fourier-Features & PyTorch.
https://github.com/pointer2alvee/mlp-timeseries-interpolation-extrapolation

Last synced: 7 months ago
JSON representation

A bivariate timeseries dataset cleaned, interpolated & extrapolated using MLP, Fourier-Features & PyTorch.

Awesome Lists containing this project

README

          


Image 1

## ๐Ÿ“œ mlp-timeseries-interpolation-extrapolation
#### ๐Ÿ“Œ Summary
Implementation of a Multi-Layer Perceptron (MLP) using PyTorch for modeling, interpolation, and extrapolation of bivariate time series data `(x(t), y(t))` given scalar time input `t`.

#### ๐Ÿง  Overview
This project leverages a deep learning-based MLP (Multi-Layer Perceptron) model to approximate noisy 2D time series data using Python and PyTorch. The model is trained to learn a mapping from scalar input time `t` to two-dimensional spatial coordinates `x` and `y`.

This effectively enables:
- **Interpolation** โ€” Estimating missing or unobserved values within the data range where 0๐Ÿ“ฅ (1) Data Preprocessing:
- Load and clean dataset (`data.csv`)
- Remove rows with invalid or missing entries
- Convert all values to numerical type
- Plot `x(t)` and `y(t)` for exploration

๐Ÿค– (2) MLP Model - Interpoaltion:
- Multi-layer fully connected neural network
- Input: scalar `t`, Output: vector `(x, y)`
- Layers: 1 โ†’ 64 โ†’ 128 โ†’ 256 โ†’ 2
- ReLU activations
- Output: 2D prediction of time-series position

๐Ÿ“‰ (3) Loss & Optimization:
- Loss Function: Mean Squared Error
- Optimizer: Adam

๐Ÿ“Š Evaluation:
- Plotting predicted vs true curves
- Visualization for both interpolation & extrapolation

---

#### โš™๏ธ Installation
```bash
git clone https://github.com/pointer2Alvee/mlp-timeseries-interpolation-extrapolation.git
cd mlp-timeseries-interpolation-extrapolation

# Recommended: Use virtual environment
pip install -r requirements.txt
```

##### ๐Ÿ–‡๏ธ requirements.txt (core packages):
```
pandas
numpy
matplotlib
scikit-learn
torch
```

##### ๐Ÿ’ป Running the App Locally
1. Open the Jupyter notebook `mlp-timeseries.ipynb`
2. Run all cells sequentially
3. Visualize plots of predicted vs actual time series

---

### ๐Ÿ“– Usage
- Open the project in **Google Colab** or **Jupyter Notebook**
- Adjust model layers or learning rate as needed
- Upload your own time series CSV (with `t`, `x`, `y` columns) for testing

---

### ๐Ÿงช Sample Topics Implemented
- โœ… Deep MLP for regression
- โœ… Time series interpolation/extrapolation
- โœ… PyTorch model training
- โœ… Data visualization for time series

---

### ๐Ÿงญ Roadmap
- [x] Basic MLP model for 2D regression
- [x] Time series interpolation & extrapolation
- [x] Add Fourier-based feature transformation
- [ ] Compare with traditional regressors (SVR, GPR)

---

### ๐Ÿค Contributing
Contributions are welcomed!
1. Fork the repo
2. Create a branch: `git checkout -b feature/YourFeature`
3. Commit changes: `git commit -m 'Add some feature'`
4. Push to branch: `git push origin feature/YourFeature`
5. Open a Pull Request

---

### ๐Ÿ“œ License
Distributed under the MIT License. See `LICENSE` for more information.

---

### ๐Ÿ™ Acknowledgements
- PyTorch Team
- Kaggle Community
- Open-source contributors and visualization libraries