# farhanrhine/auto-feature-selector-tool architecture

> Architecture diagram of the GitHub repository farhanrhine/auto-feature-selector-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/farhanrhine/auto-feature-selector-tool
- Repository: https://github.com/farhanrhine/auto-feature-selector-tool

## Overview

##### Project type and purpose
- This is a lightweight, Python-based data-preprocessing CLI tool.
- Its sole responsibility is to ingest a dataset, perform cleaning and feature-engineering steps, and output a clean dataset.

##### File structure
- Top-level files only:
- app.py – the main script (entry point)
- helper.py – reusable functions for each cleaning/transformation step
- requirements.txt – external Python libraries (e.g., pandas, numpy)
- readme.md – workflow description
- No frontend or database; this is a simple command-line pipeline.

##### README for additional insights
- The workflow enumerates eight sequential stages:
1. Data ingestion
2. Unnecessary-column removal
3. Missing/duplicate data detection & handling
4. Missing-value imputation techniques
5. Data summary/statistics
6. Categorical/object feature transformation
7. Train/test split
8. Feature selection
- End goal: produce or download a cleaned dataset.

a. Main components (modules & artifacts)
- CLI entrypoint (app.py)
- Helper module (helper.py)
- Individual processing stages as sub-modules or functions:
– Data Reader
– Column Pruner
– MissingValueHandler
– ImputationEngine
– DataAnalyzer
– Transformer
– Splitter
– FeatureSelector
- Data stores (files on disk): Raw Dataset, Cleaned Dataset
- External dependencies (pandas, numpy, etc.)
b. Relationships & interactions
– app.py orchestrates the pipeline: imports helper.py, invokes each stage in sequence
– Each stage receives a DataFrame, returns a DataFrame
– Final stage writes output to disk or returns a download URL
c. Architectural patterns & design principles
– Pipeline (chain of responsibility): each step is isolated, testable, and composable
– Modularization: helper.py groups reusable functions
– Single Responsibility: each function/stage does one job
d. Key technologies & libraries
– Python 3.x
– pandas for data manipulation
– numpy for numeric operations

##### Detailed checklist for the architect
- If a stage splits into two (e.g., branching for different imputation strategies), show a fork and later join.
- Optionally, annotate each module with its primary Python functions (e.g., MissingValueHandler.handle_nulls()).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Stores
    RawDataset[(Raw Dataset\nraw.csv)]:::data
    CleanedDataset[(Cleaned Dataset\nclean.csv)]:::data

    %% External
    ExternalLibs["External Deps:\npandas, numpy"]:::external
    Requirements["requirements.txt"]:::external
    Documentation["readme.md"]:::external

    %% Code Modules
    CLI["CLI Entrypoint\napp.py"]:::code
    Reader["Data Reader\nread_data()"]:::code
    Pruner["Column Pruner\nprune_columns()"]:::code
    MissingHandler["MissingValueHandler\nhandle_missing()"]:::code
    Imputer["ImputationEngine\nimpute_values()"]:::code
    Analyzer["DataAnalyzer\nsummarize_data()"]:::code
    Transformer["Transformer\ntransform_features()"]:::code
    Splitter["Splitter\nsplit_data()"]:::code
    Selector["FeatureSelector\nselect_features()"]:::code

    %% Pipeline Flow
    RawDataset -->|pandas.DataFrame| CLI
    CLI -->|pandas.DataFrame| Reader
    Reader -->|pandas.DataFrame| Pruner
    Pruner -->|pandas.DataFrame| MissingHandler
    MissingHandler -->|pandas.DataFrame| Imputer
    Imputer -->|pandas.DataFrame| Analyzer
    Analyzer -->|pandas.DataFrame| Transformer
    Transformer -->|pandas.DataFrame| Splitter
    Splitter -->|pandas.DataFrame| Selector
    Selector -->|pandas.DataFrame| CleanedDataset

    %% External to Modules
    ExternalLibs -.-> CLI
    ExternalLibs -.-> Reader
    ExternalLibs -.-> Pruner
    ExternalLibs -.-> MissingHandler
    ExternalLibs -.-> Imputer
    ExternalLibs -.-> Analyzer
    ExternalLibs -.-> Transformer
    ExternalLibs -.-> Splitter
    ExternalLibs -.-> Selector

    %% Click Events
    click CLI "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/app.py"
    click Reader "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Pruner "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click MissingHandler "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Imputer "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Analyzer "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Transformer "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Splitter "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Selector "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/helper.py"
    click Requirements "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/requirements.txt"
    click Documentation "https://github.com/farhanrhine/auto-feature-selector-tool/blob/main/readme.md"

    %% Styles
    classDef code fill:#D0E8FF,stroke:#0066CC,color:#003366;
    classDef data fill:#DFFFE0,stroke:#33AA00,color:#336600;
    classDef external fill:#FFE4B2,stroke:#FF7700,color:#994C00;
```
