Metadata-Version: 2.4
Name: autoseqmodels
Version: 0.1.0
Summary: Automated weekly sequence-model workflow (LSTM / Transformer) for customer transaction prediction.
Author-email: Pablo Huber <pablohuber.ge@gmail.com>
License-Expression: MIT
Keywords: sequence-models,lstm,transformer,transaction-prediction,customer-lifetime-value,time-series
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
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
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0
Requires-Dist: numpy>=1.24
Requires-Dist: matplotlib>=3.7
Requires-Dist: torch>=2.0
Requires-Dist: torchmetrics>=1.0
Requires-Dist: optuna>=3.0
Requires-Dist: tqdm>=4.65
Requires-Dist: pyreadr>=0.5
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# autoseqmodels

Automated weekly sequence-model workflow for customer transaction prediction.
Provides an end-to-end pipeline from raw transaction tables to trained LSTM /
Transformer models, with column-type inference, encoding strategy proposal,
per-customer sequence construction, training, tuning (Optuna), and
holdout evaluation.

## Installation

```bash
pip install autoseqmodels
```

Or from a local clone:

```bash
pip install -e .
```

## Workflow

```python
from autoseqmodels import (
    loader, inspection, encoders, sequence_builder,
    training, sequence_lstm, sequence_transformer,
)

# 1. Load data (CSV / Excel / RData)
df = loader.load_table("transactions.csv")

# 2. Aggregate raw transactions to a (customer, week) panel
panel = loader.build_transaction_panel(df, ...)

# 3. Detect column types (user-editable)
detected = inspection.infer_column_types(panel)
panel = inspection.cast_columns_by_detected_type(panel, detected)

# 4. Resolve entity / date / target + covariate plan
structure, plan = inspection.analyze_structure(panel, detected)

# 5. Propose encoding strategy (user-editable)
strategy = encoders.propose_encodings(panel, detected, plan)

# 6. Fit encoders on training rows only
enc_df, spec = encoders.apply_encodings(panel, strategy, ...)
plan = encoders.expand_plan(plan, spec)

# 7. Build per-customer sequences
seqs = sequence_builder.build_transaction_sequences(enc_df, ...)

# 8. Train / tune / evaluate
model = sequence_lstm.train_tuned_lstm(seqs, ...)
preds = sequence_lstm.predict_holdout(model, seqs)
```

## Modules

- `loader` — read CSV / Excel / RData and build the (customer, week) panel
- `inspection` — column-type inference, structural analysis, casting
- `encoders` — encoding strategy proposal and fitting (scale / one-hot / embed)
- `sequence_builder` — per-customer sequence construction with calibration / holdout split
- `training` — generic dataset, train/val split, training loop, evaluation, plotting
- `sequence_lstm` — `SequenceLSTM`, `predict_holdout`, `tune_lstm`, `train_tuned_lstm`
- `sequence_transformer` — `SequenceTransformer` and matching tune / train / predict helpers

## Requirements

Python ≥ 3.10. See `pyproject.toml` for the full dependency list.

## License

MIT — see [LICENSE](LICENSE).
