How clachar94/humanbehaviorai works
Purpose and scope
Human Behavior AI is a data/AI project for detecting digital manipulation and artificial user behavior, especially bot accounts. Its repository is organized as a staged data pipeline plus phase-oriented analysis notebooks, rather than as a deployable application source tree.
Primary entry points
The executable pipeline is represented by ordered Python scripts:
• scripts/01_carga.py
• scripts/02_limpieza.py
• scripts/03_procesamiento.py
The scripts imply a sequential run order: ingest, clean, then transform/process. Exploratory, modeling, integration, and scalability work is captured in Jupyter notebooks, notably notebooks/Fase3.ipynb, notebooks/Fase4.ipynb, and notebooks/Fase5_Integracion_Automatizacion.ipynb.
Data ingestion and persistence
Raw bot-detection input is stored at data/raw/bot_detection_data.csv. The loading stage in scripts/01_carga.py is the boundary between file-based source data and downstream processing/storage.
A committed database artifact, humanbehaviorai.db, indicates local database persistence or experimentation. The README names PostgreSQL as the intended database technology, but no PostgreSQL schema, connection configuration, or deployment assets are present; engineers should validate whether the .db file is SQLite-derived and how it relates to the stated target database.
Data quality and feature-processing pipeline
scripts/02_limpieza.py is the data-quality boundary, responsible for converting raw records into a form suitable for analysis. scripts/03_procesamiento.py then performs the processing stage that produces the available processed dataset:
• data/processed/bot_detection_procesado.csv
• data/raw/bot_detection_data.csv
The processed CSV is the likely contract between ETL/preparation and model-analysis stages. Any automated rerun should preserve this raw-to-processed lineage and avoid treating the processed file as an independent source of truth.
Analytics and AI stages
Phase 4 notebooks contain the main analysis and AI work described by the project: anomaly detection and classification of automated accounts. Relevant artifacts include:
• notebooks/Fase4.ipynb
• notebooks/Fase4_Analisis_e_IA.ipynb
• notebooks/Fase4 Etapas 1-2-5.ipynb
Python, Pandas, and Scikit-Learn are the declared analytical runtime stack. Models and feature logic appear notebook-centered; there are no separate reusable model modules or serialized model artifacts in the tree.
Integration and operational evolution
Integration/automation and scalability are documented as later notebook phases:
• notebooks/Fase5_Integracion_Automatizacion.ipynb
• notebooks/Fase6_Escalabilidad_Nube_Optimizacion.ipynb
• notebooks/Fase4_Etapas_1-2-5-6-7-8.ipynb
These notebooks are the primary evidence of operational design, but the repository contains no visible scheduler, container, cloud infrastructure, CI workflow, API, or Streamlit application code. Streamlit and cloud/scalability should therefore be treated as intended or notebook-demonstrated capabilities, not established runtime entry points.
Key architectural boundaries
1. Source data: data/raw/bot_detection_data.csv.
2. ETL scripts: scripts/01_carga.py → scripts/02_limpieza.py → scripts/03_procesamiento.py.
3. Curated analytical dataset: data/processed/bot_detection_procesado.csv.
4. AI experimentation/modeling: Phase 4 notebooks.
5. Persistence and external-service boundary: humanbehaviorai.db locally, with PostgreSQL identified as the target external database technology.
The main modernization opportunity is to convert notebook-derived transformation and model logic into versioned Python modules, with explicit database contracts and a reproducible orchestration path.
Main entry points: Fase4.ipynb Phase 4 AI analysis · 01_carga.py Load · bot_detection_procesado.csv Processed dataset · 02_limpieza.py Clean data
Components 15
ETL Pipeline
Ordered scripts transform source records into a curated dataset.
- Load · Ingestion boundary from the source file.
scripts/01_carga.py - Clean data · Data-quality stage.
scripts/02_limpieza.py - Process data · Transforms cleaned records for analysis.
scripts/03_procesamiento.py
Analytics & AI
Notebook-centered analysis, modeling, and operational exploration.
- Phase 3 exploration
notebooks/Fase3.ipynb - Phase 4 AI analysis · Anomaly detection and automated-account classification.
notebooks/Fase4.ipynb - Phase 4 analysis & AI
notebooks/Fase4_Analisis_e_IA.ipynb - Phase 4 stages
notebooks/Fase4 Etapas 1-2-5.ipynb - Python analytics stack · Notebook runtime for feature work and models.
- Integration & automation · Notebook-demonstrated operational design, not an established runtime.
notebooks/Fase5_Integracion_Automatizacion.ipynb - Scalability & cloud · Explores intended scalability and cloud evolution.
notebooks/Fase6_Escalabilidad_Nube_Optimizacion.ipynb - Extended Phase 4 stages
notebooks/Fase4_Etapas_1-2-5-6-7-8.ipynb
Other components
- Raw bot dataset
data/raw/bot_detection_data.csv - Processed dataset · Curated ETL output used by analytical stages.
data/processed/bot_detection_procesado.csv - Local DB artifact · Persistence or experimentation artifact; database engine needs validation.
humanbehaviorai.db - PostgreSQL target · Named as target technology, without repository schema or connection assets.
Connections 14
- Raw bot dataset → Load: ingests
- Load → Clean data: loaded records
- Clean data → Process data: cleaned records
- Process data → Processed dataset: writes
- Load → Local DB artifact: may persist
- Local DB artifact → PostgreSQL target: target migration unclear
- Processed dataset → Phase 3 exploration: explored by
- Processed dataset → Phase 4 AI analysis: analysis input
- Phase 4 AI analysis → Phase 4 analysis & AI: complementary analysis
- Phase 4 AI analysis → Phase 4 stages: staged work
- Python analytics stack → Phase 4 AI analysis: runtime
- Phase 4 AI analysis → Integration & automation: integration evolution
- Integration & automation → Scalability & cloud: scalability evolution
- Phase 4 AI analysis → Extended Phase 4 stages: extended stages