Skip to main content

AutoML with Enhanced Track-Rail Algorithm, meta-learning, feature engineering, explainability, and smart ensemble fusion.

Project description

traauto: Advanced AutoML with Enhanced Track-Rail Algorithm

Overview

traauto is a comprehensive, research-grade AutoML library that builds upon the success of the original TRA Algorithm (tra-algorithm), extending the Track/Rail ensemble strategy with full automation, advanced feature engineering, meta-learning, dynamic model fusion, and explainable AI. This package is designed for practitioners and researchers who need both flexibility and state-of-the-art automation for classification or regression tasks, supporting modern datasets and robust analysis pipelines.

About TRA Algorithm (tra-algorithm)

The original TRA Algorithm is an innovative ensemble framework that routes data between specialized models ("tracks") using real-time signals, enabling adaptive, explainable, parallel processing for both classification and regression. Key features included:

  • Dynamic track switching & adaptive routing
  • Advanced signal-based decision logic
  • Track pruning and usage optimization
  • Robust visualization and reporting APIs
  • Full support for regression and classification tasks

For more details and usage of the original TRA Algorithm, see the tra-algorithm documentation.

About traauto

traauto takes the core concept of dynamic track-based ensembles and delivers a full AutoML pipeline with these major enhancements:

  • Automated Feature Engineering: Generation, selection, and transformation of features with adaptive regularization, interaction, transformation, and aggregation.
  • Meta-Learning & Model Selection: Suggests architectures and hyperparameters using dataset meta-features and Optuna-based optimization.
  • Smart Routing Engine: Intelligent per-record routing to specialized tracks, using meta-analytics, confidence, and feature specialization.
  • Dynamic Ensemble Fusion: Advanced fusion strategies (stacking, weighted voting, smart fusion) optimize overall predictions dynamically.
  • Regional Track Creation: Automated clustering to create regional/subtrack models for data specialization.
  • Explainability: Supports SHAP, LIME, and feature importances for interpretability of predictions and model behaviour.
  • Resource Monitoring and Adaptive Checkpoints: Tracks performance, memory usage, and provides checkpoint/resume capability.
  • System Health & Analysis: Rich system summaries, track evaluations, routing analytics, and report generation.
  • Project Persistence: Built-in checkpointing and reload via joblib for pipeline reproducibility.

Installation

Install from PyPI:

pip install traauto

Quick Start: Classification Example

from traauto import EnhancedTrackRailSystem, TRAConfig
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
import numpy as np

def test_classification():
    # Generate data with compatible parameters
    X, y = make_classification(
        n_samples=120,
        n_features=10,
        n_classes=3,
        n_informative=3,
        random_state=0
    )
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)

    config = TRAConfig(task_type="classification")
    tra = EnhancedTrackRailSystem(config=config)
    tra.fit(X_train, y_train)
    y_pred = tra.predict(X_test)

    assert len(y_pred) == len(y_test)
    print("Classification test passed.")
    metrics = tra.get_performance_metrics(X_test, y_test)
    print("Classification accuracy:", metrics.get("overall_accuracy", "N/A"))
    print("F1-score:", metrics.get("f1_score", "N/A"))

if __name__ == "__main__":
    test_classification()
    print("-" * 40)

Main Components and Capabilities

  • EnhancedTrackRailSystem: Main system class combining all automation and analysis engines.
  • TRAConfig: Configuration object for defining task type, feature engineering, meta-learning, resource constraints, and fusion strategies.
  • AutomatedFeatureEngineer: Generates, transforms, and selects features adaptively.
  • MetaLearningEngine: Analyzes dataset meta-features and applies hyperparameter optimization.
  • SmartRoutingEngine: Dynamically chooses the best model/track per input using auditing.
  • DynamicEnsembleFusion: Combines track outputs with weighted, voting, stacking, or smart fusion methods.
  • ExplainabilityEngine: Produces SHAP/LIME/feature importance explanations for model or record-level predictions.
  • Checkpointing: Safely saves and reloads full system state for reproducibility.

Algorithm Architecture

  1. Feature Engineering: The system automatically performs feature selection, interaction, transformation, and aggregation.
  2. Track/Model Training: Multiple tracks (ensembles) are created for global and regional data distributions. Each receives optimized, specialized training.
  3. Meta-Learning: Dataset statistics are extracted to suggest and tune model architectures and fusion strategies.
  4. Routing & Prediction: For each new record, automl-tra routes data to the most suitable track/model using feature-based analytics and confidence.
  5. Ensemble Fusion: Track predictions are combined using quality-weighted or stacking methods, adapting to dataset and model performance.
  6. Explainability: Explanations are generated on-demand for individual predictions, tracks, or overall system behaviour.
  7. Analysis & Reporting: System health, track statistics, and rich routing analysis are readily available.
  8. Project Persistence: Full checkpoint and reload capability for workflows and reproducibility.

Advanced Features

  • Automated Clustering for Regional Tracks: High quality clustering (KMeans, DBSCAN) creates specialized regional tracks for improved accuracy.
  • Adaptive Signal and Routing Creation: Meta-learned signals guide the routing engine to maximize predictive performance.
  • Explainable AI Support: SHAP, LIME, and fallback importances provide interpretability for output and decisions.
  • System Health Checks and Monitoring: Monitor latency, memory, stability, and prediction efficiency.
  • Checkpoint/Restore: Robust project checkpointing for safe experiment pause/resume or deployment.
  • Full Support for Imbalanced Data: Optional SMOTE integration and automatic class weight generation.

Comparison: tra-algorithm vs automl-tra

Feature tra-algorithm traauto (this package)
Ensemble Track Routing Dynamic track switching Advanced, meta-learned, per-record
Signal Evaluation Adaptive, parallel signals Meta-driven, smart routing engine
AutoML Pipeline Manual feature prep Automated feature engineering, NAS
Meta-Learning & Architecture Static models Automated model suggestion & optimization
Feature Engineering Basic (scikit-learn) Advanced, regularized & aggregated
Dynamic Ensemble Fusion Voting/weighted fusion Smart fusion, stacking, advanced fusion
Explainable AI Track-level Track-level & record-level (SHAP/LIME)
Checkpointing & Recovery Yes
System Health/Analysis Basic logging/reporting Full system and track analytics
Task Support Classification/Regression Both, with more robust architecture

Requirements

  • Python >= 3.7
  • numpy, pandas, scikit-learn, joblib, psutil
  • Optional (for full feature set): optuna, torch, xgboost, lightgbm, shap, lime, imbalanced-learn

Support & Issues

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use automl-tra in your research, please cite:

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

traauto-0.1.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

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

traauto-0.1.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traauto-0.1.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for traauto-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bec1dfa895a1b69ae09444fb8cd7f0d9b7f0867589ecf5533202ac301ae13792
MD5 b30c727269306d2bda7df259f6333bce
BLAKE2b-256 9faa2659a08510db2f582699c98689e3fe0b6992693991d2a48ffcd2b3d90254

See more details on using hashes here.

File details

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

File metadata

  • Download URL: traauto-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for traauto-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f2932d8c16bbf8d562eb0c3a20dd00f1c80fe720b18b69089b5641434a8e993
MD5 87bc1c713a92a1ae6a288b3f6a2d9498
BLAKE2b-256 5da4e3276fe97ad327d14831219690494929edf7d89210f207102eb16e776274

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