How ramirezlzrga/ia_futured works
Purpose
IA_FUTURED predicts student dropout risk from survey data. It produces a risk percentage, likely reason, and recommendations, with MongoDB Atlas as the stated persistence/integration service.
Entry Points
• main.py is the likely application orchestrator and operational entry point.
• generar_alumnos_en_riesgo.py likely runs batch identification/generation of at-risk students.
• prediccion_alumno.py likely exposes the per-student prediction flow.
Model Training and Artifact Boundary
• modelo.py defines the ML model/training or model-loading logic.
• Serialized production artifacts separate training from inference:
- modelo_entrenado/modelo.pkl
- modelo_entrenado/label_encoders.pkl
• Inference must use the persisted model and matching encoders; feature encoding consistency is a critical boundary.
Prediction Pipeline
The core per-student flow is expected to:
1. Obtain survey/student inputs.
2. Encode categorical values using modelo_entrenado/label_encoders.pkl.
3. Score the input with modelo_entrenado/modelo.pkl.
4. Convert the score into risk percentage, probable cause, and recommendations.
5. Return or persist the resulting student-risk record.
Relevant implementation paths:
• prediccion_alumno.py
• modelo.py
• modelo_entrenado/modelo.pkl
Batch At-Risk Student Processing
generar_alumnos_en_riesgo.py represents a batch-oriented stage that likely applies prediction logic across a population, filters or labels high-risk students, and prepares records for downstream review or storage. It should reuse the same prediction/model-artifact path as single-student scoring to avoid divergent risk classifications.
Database Integration
• conexion.py is the MongoDB Atlas connection boundary.
• Application stages should isolate database reads/writes behind this module rather than embedding connection behavior in model code.
• MongoDB Atlas holds or exchanges survey/student data and predicted-risk outputs.
Runtime and Dependencies
• Python is the repository runtime, indicated by the .py entry modules.
• Dependencies are declared in requerimientos.txt.
• The repository includes prebuilt binary model artifacts, so deployment requires compatible Python/library versions for pickle deserialization.
Architectural Boundaries
• Data access: conexion.py
• Model and feature transformation: modelo.py, modelo_entrenado/label_encoders.pkl
• Inference/application logic: prediccion_alumno.py, main.py
• Population/batch workflow: generar_alumnos_en_riesgo.py
• Persisted ML contract: modelo_entrenado/modelo.pkl
Main entry points: prediccion_alumno.py Student prediction · generar_alumnos_en_riesgo.py Batch risk generation · conexion.py MongoDB connection · modelo.py Model logic
Components 11
Python application
- Application orchestrator
main.py - Student prediction · Produces risk, probable cause, and recommendations.
prediccion_alumno.py - Batch risk generation · Scores a population and identifies at-risk students.
generar_alumnos_en_riesgo.py - Dependencies · Compatible library versions are required to deserialize model pickles.
requerimientos.txt
ML contract
Persisted artifacts keep training and inference compatible.
- Model logic · Defines model training or persisted-model loading.
modelo.py - Trained model
modelo_entrenado/modelo.pkl - Label encoders · Categorical encoding must match model training.
modelo_entrenado/label_encoders.pkl
Data integration
- MongoDB connection · Isolates Atlas connectivity from model code.
conexion.py - MongoDB Atlas · Stores or exchanges student surveys and risk outputs.
- Student survey data
- Student risk record · Risk percentage, likely reason, and recommendations.
Connections 15
- Application orchestrator → Student prediction: orchestrates
- Application orchestrator → Batch risk generation: runs
- Student prediction → Label encoders: encodes inputs
- Student prediction → Trained model: scores student
- Batch risk generation → Student prediction: reuses scoring
- Model logic → Trained model: trains or loads
- Model logic → Label encoders: creates or loads
- Dependencies → Model logic: runtime libraries
- MongoDB connection → MongoDB Atlas: connects
- MongoDB Atlas → Student survey data: provides
- Student prediction → MongoDB connection: reads and writes
- Batch risk generation → MongoDB connection: reads and writes
- Student prediction → Student risk record: produces
- Batch risk generation → Student risk record: produces
- MongoDB connection → Student risk record: persists