Metadata-Version: 2.4
Name: spotanomaly2
Version: 2.1.1
Summary: Streamlined anomaly detection system for time series data
Project-URL: Homepage, https://github.com/sequential-parameter-optimization/spotanomaly2
Project-URL: Repository, https://github.com/sequential-parameter-optimization/spotanomaly2
Project-URL: Issues, https://github.com/sequential-parameter-optimization/spotanomaly2/issues
Author-email: bartzbeielstein <32470350+bartzbeielstein@users.noreply.github.com>
License: AGPL-3.0-or-later
License-File: LICENSE
Keywords: anomaly-detection,forecasting,machine-learning,time-series
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.13
Requires-Dist: catboost>=1.2.10
Requires-Dist: entsoe-py>=0.6.0
Requires-Dist: joblib>=1.3.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=3.0.0
Requires-Dist: plotly>=5.14.0
Requires-Dist: pyarrow>=12.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.31.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: scipy-stubs~=1.17.1
Requires-Dist: scipy>=1.10.0
Requires-Dist: spotanomaly2-safe>=0.1.0
Requires-Dist: spotforecast2-safe>=15.6.0
Requires-Dist: spotforecast2>=3.5.0
Requires-Dist: spotoptim>=0.0.160
Requires-Dist: typing-extensions>=4.5.0
Requires-Dist: watchdog>=3.0.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# SpotAnomaly

Streamlined anomaly detection system for time series data with dual training paradigms (batch and online learning).

## Requirements

- Python 3.10 or higher
- [uv](https://docs.astral.sh/uv/) package manager (recommended)

## Installation

### Using uv (Recommended)

Install uv:

```bash
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Homebrew
brew install uv

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
```

Set up the project:

```bash
uv sync
```

This command automatically installs Python 3.11, creates a virtual environment, and installs all dependencies.

### Using pip

```bash
python3.11 -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .
```

## Usage

### Configuration

Choose your training paradigm in `config/default.yaml`:

```yaml
model:
  paradigm: "batch"  # or "online"
```

- **batch**: Traditional batch training with sklearn/LightGBM (faster, trains once)
- **online**: Streaming online learning with river (incremental updates)

### Running the Pipeline

Run all steps a first time:

```bash
uv run python -m src all
```

Run all steps but skip the download:

```bash
uv run python -m src all --skip-download
```

Or run individual steps:

```bash
uv run python -m src process  # Process raw data
uv run python -m src train    # Train forecasting models
uv run python -m src detect   # Detect anomalies
```

Run predictions with a pre-trained model:

```bash
uv run python -m src all --predict-only --model 20251229_172126
```

### Viewing the result
You can explore, chart, and analyze the processed and modeled data interactively in [notebooks/analyze_combined.ipynb](notebooks/analyze_combined.ipynb).


### Running live mode

```bash
uv run python -m src live --interval 5
```

Then open [the live report](data/results/live/report.html)

## Development

Install with development dependencies:

```bash
uv sync --all-extras
```