How autoviml/auto_viml works
This project, Auto-ViML, is an open‐source automated machine learning (AutoML) tool focused on quickly building high-performance yet interpretable models. Its purpose is to take in a user’s dataset and automatically perform data cleaning, feature engineering (including automatic feature selection and removal of highly correlated variables via SULOV), and then run multiple modeling algorithms (from linear to ensemble, boosting, and even CatBoost) in order to identify the best performing model with the fewest features.
Project Type and Purpose
• Auto-ViML is a library/package designed specifically for rapid prototyping of machine learning models.
• It provides automatic data preprocessing, feature selection methods, and model building approaches depending on user-selected flags.
• In effect, it serves as an “accelerator” for data scientists to establish a baseline model quickly.
File Structure
• Top-Level Files/Directories:
• Files like .gitignore, LICENSE, CONTRIBUTING.md, and setup.py indicate standard package management.
• The “autoviml” directory contains the core modules.
• Inside the “autoviml” directory, you observe several modules:
• Auto_ViML.py: Likely the main orchestrator that ties the entire process together.
• Auto_NLP.py: Handles automated processing of textual data.
• QuickML_Ensembling.py and QuickML_Stacking.py: Contain methods for ensembling and stacking techniques.
• Transform_KM_Features.py: Implements feature transformation using clustering (e.g., KMeans).
• Modules for feature engineering, custom scores, classification methods, and handling highly correlated features (SULOV).
• The presence of a “requirements.txt” and setup configuration files indicate that dependency management is handled in a standardized way.
Key Components
a. Data Input and Preprocessing Layer:
• Data Loading: Reading CSV or text files into Pandas dataframes.
• Data Cleaning & Transformation: Handling dirty data, missing values, formatting, and initial transformations.
• Auto_NLP Module: Specifically for processing text variables.
• Date-Time Processing: Automatic detection and transformation of date-time variables.
b. Feature Engineering and Selection Layer:
• Feature Engineering Module: (feature_engineering.py) performs variable generation and transformation.
• SULOV Module: Removes highly correlated features.
• Quick Feature Selection: Selecting minimal features that yield good performance (leveraging methods like recursive XGBoost and algorithms similar to those in featurewiz).
• KM-Based Feature Transformations: (by Transform_KM_Features.py, and optionally, KMeans_Featurizer) that introduces cluster-based features.
c. Model Building and Evaluation Layer:
• Auto_ViML Core Module: Orchestrates the overall workflow, switches between modeling approaches based on input flags (hyper_param, boosting_flag, stacking_flag, etc.).
• Multiple Modeling Strategies:
• Linear Models (when Boosting_Flag is None).
• Random Forest/Extra Trees (when Boosting_Flag is False).
• XGBoost Models (when Boosting_Flag is True).
• CatBoost Models (when Boosting_Flag is 'CatBoost').
• Ensembling & Stacking: Modules (QuickML_Ensembling.py and QuickML_Stacking.py) which integrate predictions from different models.
• GPU Acceleration: Optional path/flag for speeding up processing using GPUs (as noted in the README).
d. Output and Visualization Layer:
• Metrics and Performance Dashboard: Generation of performance charts/results (modulated by the 'verbose' parameter).
• Submission File Generation: Writes the output submission CSV file when a test set is provided.
Relationships and Interactions
• Data flows sequentially from the Data Input layer to Preprocessing, then to Feature Engineering.
• The engineered features are then passed to Model Building where the appropriate model is selected based on configuration flags.
• Performance evaluation (and potentially intermediate visualizations) is then handled before production of the final submission file.
• Several components interact in a modular and sometimes parallel manner (e.g., feature engineering steps and text processing are independent modules that feed into the core Auto_ViML orchestration).
Architectural Patterns and Technologies
• Modular Design: Each module (e.g., Auto_NLP, SULOV, ensembling) is developed as a self-contained unit that the core Auto_ViML module invokes.
• Plug-and-Play Architecture: Different model types and feature transformations can be toggled via parameters.
• Utilization of core Python libraries such as scikit-learn, numpy, pandas, matplotlib, and others like XGBoost, CatBoost, SHAP, and imbalanced_ensemble.
• The design adheres to standard package structures allowing for ease of maintenance and extension.
Elements
• Use clear, descriptive labels for each component (e.g., “Data Loader”, “Auto_NLP”, “Feature Engineering”, “SULOV Selector”, “Model Orchestrator”).
Happy diagramming!