Metadata-Version: 2.4
Name: ddmtolab
Version: 1.0.0
Summary: Data-Driven Multitask Optimization Laboratory
Author-email: Jiangtao Shen <j.shen5@exeter.ac.uk>
License: MIT
Project-URL: Homepage, https://github.com/JiangtaoShen/DDMTOLab
Project-URL: Documentation, https://jiangtaoshen.github.io/DDMTOLab/
Project-URL: Bug Tracker, https://github.com/JiangtaoShen/DDMTOLab/issues
Keywords: optimization,multitask-optimization,evolutionary-algorithm,surrogate-model,bayesian-optimization,machine-learning
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0.1
Requires-Dist: scipy>=1.15.3
Requires-Dist: pandas>=2.3.3
Requires-Dist: matplotlib>=3.10.6
Requires-Dist: scikit-learn>=1.7.2
Requires-Dist: tqdm>=4.67.1
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: seaborn>=0.13.2
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: bottleneck>=1.4.2
Requires-Dist: torch>=2.5.1
Requires-Dist: botorch>=0.16.0
Requires-Dist: gpytorch>=1.14.2
Requires-Dist: pyro-ppl>=1.9.1
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: sphinx>=7.4.7; extra == "dev"
Requires-Dist: sphinx-rtd-theme>=3.0.2; extra == "dev"
Requires-Dist: sphinx-autodoc-typehints>=2.3.0; extra == "dev"
Requires-Dist: myst-parser>=3.0.1; extra == "dev"
Provides-Extra: all
Requires-Dist: ddmtolab[dev]; extra == "all"
Dynamic: license-file

# DDMTOLab

<p align="center">
  <img src="docs/source/_static/logo.png" alt="DDMTOLab Logo" width="250">
</p>

<p align="center">
  <strong>Data-Driven Multitask Optimization Laboratory</strong>
</p>

<p align="center">
  <a href="https://jiangtaoshen.github.io/DDMTOLab/">
    <img src="https://img.shields.io/badge/docs-latest-blue.svg" alt="Documentation">
  </a>
  <a href="https://github.com/JiangtaoShen/DDMTOLab/stargazers">
    <img src="https://img.shields.io/github/stars/JiangtaoShen/DDMTOLab?style=social" alt="GitHub Stars">
  </a>
  <a href="https://www.python.org/downloads/">
    <img src="https://img.shields.io/badge/Python-3.10+-blue.svg" alt="Python Version">
  </a>
  <a href="https://github.com/JiangtaoShen/DDMTOLab/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License">
  </a>
</p>

---

## 📖 Overview

**DDMTOLab** is a comprehensive Python platform designed for data-driven multitask optimization, featuring **30+ algorithms**, **100+ benchmark problems**, and powerful experiment tools for algorithm development and performance evaluation.

Whether you're working on expensive black-box optimization, multi-objective optimization, or complex multi-task scenarios, DDMTOLab provides a flexible and extensible framework to accelerate your **research** and support real-world **applications**.

## ✨ Features

- 🚀 **Comprehensive Algorithms** - Single/multi-task, single/multi-objective optimization algorithms
- 📊 **Rich Problem Suite** - Extensive benchmark functions and real-world applications
- 🤖 **Data-Driven Optimization** - Surrogate modelling for expensive optimization
- 🔧 **Flexible Framework** - Simple API and intuitive workflow for rapid prototyping
- 🔌 **Fully Extensible** - Easy to add custom algorithms and problems
- 📈 **Powerful Analysis Tools** - Built-in visualization and statistical analysis
- ⚡ **Parallel Computing** - Multi-core support for batch experiments
- 📝 **Complete Documentation** - Comprehensive **[Tutorial](https://jiangtaoshen.github.io/DDMTOLab/quickstart.html)** and API reference

## 🚀 Quick Start

👉 **[Get Started with Our Tutorial](https://jiangtaoshen.github.io/DDMTOLab/quickstart.html)**

DDMTOLab requires:

* Python 3.10+
* PyTorch 2.5+ with CUDA 12.1 support (optional, for GPU-accelerated Gaussian Process modeling)
* BoTorch 0.16+
* GPyTorch 1.14+
* NumPy 2.0+
* SciPy 1.15+
* scikit-learn 1.7+
* Pandas 2.3+
* Matplotlib 3.10+
* tqdm

### Installation

```bash
git clone https://github.com/JiangtaoShen/DDMTOLab.git
cd DDMTOLab
pip install -r requirements.txt
```

### Basic Usage
```python
import numpy as np
from ddmtolab.Methods.mtop import MTOP
from ddmtolab.Algorithms.STSO.GA import GA

# Step 1: Define objective function
def t1(x):
    """Forrester function: (6x-2)^2 * sin(12x-4)"""
    return (6 * x - 2) ** 2 * np.sin(12 * x - 4)

# Step 2: Create optimization problem
problem = MTOP()
problem.add_task(t1, dim=1)

# Step 3: Run optimization
results = GA(problem).optimize()

# Step 4: Display results
print(results.best_decs, results.best_objs)

# Step 5: Analyze and visualize
from ddmtolab.Methods.test_data_analysis import TestDataAnalyzer
TestDataAnalyzer().run()
```

### Batch Experiments
```python
from ddmtolab.Methods.batch_experiment import BatchExperiment
from ddmtolab.Methods.data_analysis import DataAnalyzer
from ddmtolab.Algorithms.STSO.GA import GA
from ddmtolab.Algorithms.STSO.PSO import PSO
from ddmtolab.Algorithms.STSO.DE import DE
from ddmtolab.Algorithms.MTSO.EMEA import EMEA
from ddmtolab.Algorithms.MTSO.MFEA import MFEA
from ddmtolab.Problems.MTSO.cec17_mtso import CEC17MTSO

if __name__ == '__main__':
    # Step 1: Create batch experiment manager
    batch_exp = BatchExperiment(
        base_path='./Data',      # Data save path
        clear_folder=True        # Clear existing data
    )

    # Step 2: Add test problems
    cec17mtso = CEC17MTSO()
    batch_exp.add_problem(cec17mtso.P1, 'P1')
    batch_exp.add_problem(cec17mtso.P2, 'P2')
    batch_exp.add_problem(cec17mtso.P3, 'P3')

    # Step 3: Add algorithms with parameters
    batch_exp.add_algorithm(GA, 'GA', n=100, max_nfes=20000)
    batch_exp.add_algorithm(DE, 'DE', n=100, max_nfes=20000)
    batch_exp.add_algorithm(PSO, 'PSO', n=100, max_nfes=20000)
    batch_exp.add_algorithm(MFEA, 'MFEA', n=100, max_nfes=20000)
    batch_exp.add_algorithm(EMEA, 'EMEA', n=100, max_nfes=20000)

    # Step 4: Run batch experiments
    batch_exp.run(n_runs=20, verbose=True, max_workers=8)

    # Step 5: Configure data analyzer
    analyzer = DataAnalyzer(algorithm_order=['GA', 'DE', 'PSO', 'EMEA', 'MFEA'])

    # Step 6: Run data analysis
    results = analyzer.run()
```

## 📊 Example Results

Results from the batch experiment above:

<p align="center">
  <img src="docs/images/P1-Task1.png" alt="Convergence 1" width="28%">
  <img src="docs/images/P1-Task2.png" alt="Convergence 2" width="28%">
  <img src="docs/images/runtime_comparison.png" alt="Runtime" width="32%">
</p>

## 🎯 Key Components

### Algorithms
**40+ state-of-the-art optimization algorithms** across four categories:

| Category | Algorithms |
|----------|-----------|
| **STSO** | GA, DE, PSO, SL-PSO, KL-PSO, CSO, CMA-ES, AO, GWO, EO, BO, EEI-BO |
| **STMO** | NSGA-II, NSGA-III, NSGA-II-SDR, SPEA2, MOEA/D, MOEA/DD, RVEA, IBEA, Two_Arch2, MSEA, CCMO |
| **MTSO** | MFEA, MFEA-II, EMEA, G-MFEA, MTBO, RAMTEA, SELF, EEI-BO+, MUMBO, LCB-EMT |
| **MTMO** | MO-MFEA, MO-MFEA-II |

### Problems
**132+ benchmark problems** across five categories:

| Category | Problem Suites |
|----------|---------------|
| **STSO** | Classical Functions (9), CEC10-CSO (18) |
| **STMO** | ZDT (6), UF (10), DTLZ (9) |
| **MTSO** | CEC17-MTSO (9), CEC17-MTSO-10D (9), CEC19-MaTSO (6) |
| **MTMO** | CEC17-MTMO (9), CEC19-MTMO (10), CEC19-MaTMO (6), CEC21-MTMO (10), MTMO-Instance (2) |
| **Real-World** | PEPVM (1), PINN-HPO (12), SOPM (2), SCP (1), MO-SCP (2), PKACP (1) |

### Methods
- **Batch Experiments**: Parallel execution framework for large-scale testing
- **Data Analysis**: Statistical testing (Wilcoxon, Friedman) and visualization tools
- **Performance Metrics**: IGD, HV, Spacing, Spread, FR, CV, and more
- **Algorithm Components**: Reusable building blocks for rapid development

## 📄 Citation

If you use DDMTOLab in your research, please cite:
```bibtex
@software{ddmtolab2025,
  author = {Jiangtao Shen},
  title = {DDMTOLab: A Python Platform for Data-Driven Multitask Optimization},
  year = {2025},
  url = {https://github.com/JiangtaoShen/DDMTOLab}
}
```

## 📧 Contact

- **Author**: Jiangtao Shen
- **Email**: j.shen5@exeter.ac.uk
- **Documentation**: [https://jiangtaoshen.github.io/DDMTOLab/](https://jiangtaoshen.github.io/DDMTOLab/)
- **Issues**: [GitHub Issues](https://github.com/JiangtaoShen/DDMTOLab/issues)

## 📜 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

<p align="center">
  Made with ❤️ by <a href="https://github.com/JiangtaoShen">Jiangtao Shen</a>
</p>
