{"id":29022052,"url":"https://github.com/pointer2alvee/mlp-timeseries-interpolation-extrapolation","last_synced_at":"2025-06-26T02:37:41.739Z","repository":{"id":299958051,"uuid":"1004728128","full_name":"pointer2Alvee/mlp-timeseries-interpolation-extrapolation","owner":"pointer2Alvee","description":"A bivariate timeseries dataset cleaned, interpolated \u0026 extrapolated using MLP, Fourier-Features \u0026 PyTorch.","archived":false,"fork":false,"pushed_at":"2025-06-19T05:42:09.000Z","size":839,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T06:27:41.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointer2Alvee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T05:04:43.000Z","updated_at":"2025-06-19T05:42:12.000Z","dependencies_parsed_at":"2025-06-19T06:38:49.387Z","dependency_job_id":null,"html_url":"https://github.com/pointer2Alvee/mlp-timeseries-interpolation-extrapolation","commit_stats":null,"previous_names":["pointer2alvee/mlp-timeseries-interpolation-extrapolation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pointer2Alvee/mlp-timeseries-interpolation-extrapolation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fmlp-timeseries-interpolation-extrapolation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fmlp-timeseries-interpolation-extrapolation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fmlp-timeseries-interpolation-extrapolation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fmlp-timeseries-interpolation-extrapolation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointer2Alvee","download_url":"https://codeload.github.com/pointer2Alvee/mlp-timeseries-interpolation-extrapolation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fmlp-timeseries-interpolation-extrapolation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261988019,"owners_count":23240951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T02:37:38.875Z","updated_at":"2025-06-26T02:37:41.626Z","avatar_url":"https://github.com/pointer2Alvee.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"assets/images/mlp_ts_in_ex.png\" alt=\"Image 1\" style=\"width: 100%; margin: 10px;\"\u003e\n\u003c/div\u003e\n\n## 📜 mlp-timeseries-interpolation-extrapolation\n#### 📌 Summary  \nImplementation 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`.\n\n#### 🧠 Overview  \nThis 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`.  \n\nThis effectively enables:\n- **Interpolation** — Estimating missing or unobserved values within the data range where 0\u003ct\u003c20\n- **Extrapolation** — Predicting values beyond the existing time boundaries where 0\u003ct\u003c100\n\nThe original dataset (data.csv)[https://gist.github.com/tmramalho/51733432c88e2b834dbd70353849f887] is a noisy CSV file containing columns `t`, `x`, and `y`. Data preprocessing includes:\n- Cleaning invalid characters\n- Ensuring numerical consistency\n- Plotting for visual inspection\n\nThe MLP model consists of several fully connected layers activated with ReLU, trained to minimize mean squared error between predicted and actual positions. The project was implemented and tested entirely in a Google Colab notebook environment.\n\n**Model Architecture Summary - Interpolation**\n- Input: Scalar value `t`\n- Output: 2D vector `(x, y)`\n- Layers:\n  1. Dense Layer → 64 units\n  2. Dense Layer → 128 units\n  3. Dense Layer → 256 units\n  4. Output Layer → 2 units `(x, y)`\n- Activation: ReLU (in all hidden layers)\n\n**Loss Function**\n- Mean Squared Error (MSE)\n\n**Optimization**\n- Adam optimizer\n\n**Model Architecture Summary - Extrapolation**\n- Feature Extraction : Fourier Features\n- Input: Scalar value `t`\n- Output: 2D vector `(x, y)`\n- Layers:\n  1. Dense Layer → 128 units\n  2. Dense Layer → 256 units\n  3. Dense Layer → 61 units\n  4. Output Layer → 2 units `(x, y)`\n- Activation: ReLU (in all hidden layers)\n\n**Loss Function**\n- Mean Squared Error (MSE)\n\n**Optimization**\n- Adam optimizer\n\n#### 🎯 Use Cases\n- Time series trajectory reconstruction\n- Missing data interpolation\n- Forecasting 2D trajectories (e.g., object motion)\n- Learning noisy curve patterns\n- Educational demonstration of function approximation with deep learning\n\n#### 🟢 Project Status\n- Current Version: V1.0\n\n#### 📂 Repository Structure\n```\nmlp-timeseries-interpolation-extrapolation/\n├── README.md\n├── LICENSE\n├── .gitignore                  \n├── assets/                      \n│   └── images/\n└── notebooks/               \n    └── mlp_interpolation_extrapolation.ipynb\n```\n\n### ✨ Features\n- ✅ Cleaned time series dataset\n- ✅ MLP model for 2D prediction\n- ✅ Visualization of real vs predicted curves\n- ✅ Interpolation \u0026 extrapolation demonstration\n\n🛠️ In progress:\n- Performance comparison with other regressors\n\n---\n\n### 🚀 Getting Started\n\n#### 📚 Knowledge \u0026 Skills Required\n- Python programming\n- Basic ML/DL concepts\n- Understanding of time series and regression\n\n#### 💻 Software Requirements\n- Jupyter Notebook or Colab\n- Python ≥ 3.8\n\n#### 🛡️ Tech Stack\n- Language: Python\n- Libraries: pandas, numpy, matplotlib, scikit-learn\n- Deep Learning: PyTorch\n\n#### 🔍 Modules Breakdown\n\n\u003cb\u003e📥 (1) Data Preprocessing:\u003c/b\u003e\n- Load and clean dataset (`data.csv`)\n- Remove rows with invalid or missing entries\n- Convert all values to numerical type\n- Plot `x(t)` and `y(t)` for exploration\n\n\u003cb\u003e🤖 (2) MLP Model - Interpoaltion:\u003c/b\u003e\n- Multi-layer fully connected neural network\n- Input: scalar `t`, Output: vector `(x, y)`\n- Layers: 1 → 64 → 128 → 256 → 2\n- ReLU activations\n- Output: 2D prediction of time-series position\n\n\u003cb\u003e📉 (3) Loss \u0026 Optimization:\u003c/b\u003e\n- Loss Function: Mean Squared Error\n- Optimizer: Adam\n\n\u003cb\u003e📊 Evaluation:\u003c/b\u003e\n- Plotting predicted vs true curves\n- Visualization for both interpolation \u0026 extrapolation\n\n---\n\n#### ⚙️ Installation\n```bash\ngit clone https://github.com/pointer2Alvee/mlp-timeseries-interpolation-extrapolation.git\ncd mlp-timeseries-interpolation-extrapolation\n\n# Recommended: Use virtual environment\npip install -r requirements.txt\n```\n\n##### 🖇️ requirements.txt (core packages):\n```\npandas\nnumpy\nmatplotlib\nscikit-learn\ntorch\n```\n\n##### 💻 Running the App Locally\n1. Open the Jupyter notebook `mlp-timeseries.ipynb`\n2. Run all cells sequentially\n3. Visualize plots of predicted vs actual time series\n\n---\n\n### 📖 Usage\n- Open the project in **Google Colab** or **Jupyter Notebook**\n- Adjust model layers or learning rate as needed\n- Upload your own time series CSV (with `t`, `x`, `y` columns) for testing\n\n---\n\n### 🧪 Sample Topics Implemented\n- ✅ Deep MLP for regression\n- ✅ Time series interpolation/extrapolation\n- ✅ PyTorch model training\n- ✅ Data visualization for time series\n\n---\n\n### 🧭 Roadmap\n- [x] Basic MLP model for 2D regression\n- [x] Time series interpolation \u0026 extrapolation\n- [x] Add Fourier-based feature transformation\n- [ ] Compare with traditional regressors (SVR, GPR)\n\n---\n\n### 🤝 Contributing\nContributions are welcomed!\n1. Fork the repo  \n2. Create a branch: `git checkout -b feature/YourFeature`  \n3. Commit changes: `git commit -m 'Add some feature'`  \n4. Push to branch: `git push origin feature/YourFeature`  \n5. Open a Pull Request\n\n---\n\n### 📜 License\nDistributed under the MIT License. See `LICENSE` for more information.\n\n---\n\n### 🙏 Acknowledgements\n- PyTorch Team\n- Kaggle Community\n- Open-source contributors and visualization libraries\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointer2alvee%2Fmlp-timeseries-interpolation-extrapolation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointer2alvee%2Fmlp-timeseries-interpolation-extrapolation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointer2alvee%2Fmlp-timeseries-interpolation-extrapolation/lists"}