Skip to main content

Automated weekly sequence-model workflow (LSTM / Transformer) for customer transaction prediction.

Project description

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

pip install autoseqmodels

Or from a local clone:

pip install -e .

Workflow

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_lstmSequenceLSTM, predict_holdout, tune_lstm, train_tuned_lstm
  • sequence_transformerSequenceTransformer and matching tune / train / predict helpers

Requirements

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

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoseqmodels-0.1.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoseqmodels-0.1.0-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file autoseqmodels-0.1.0.tar.gz.

File metadata

  • Download URL: autoseqmodels-0.1.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for autoseqmodels-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91a5fc576c613de3841f3cffb407010fa5634387f73703f088a93045abbbc308
MD5 52928af41651bc0ff9c731d823bc520f
BLAKE2b-256 f8fca371e85368f13eec8aa9aa6d3c0436b5b3a606e5983dade3cc0af2f23107

See more details on using hashes here.

File details

Details for the file autoseqmodels-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: autoseqmodels-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for autoseqmodels-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3159a2bf6bc24ba3039185bba40298cb211571e6aa9b76e3b6891ca830a49af9
MD5 55cad35bd8b71e5f8ca8b995b42c4718
BLAKE2b-256 17fc216d9784dd9c99444f82b8a779413f14024ed8859cbb21862b4a253c72b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page