Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JoseOlivares19/Proyecto-PC3-JavaScript-Avanzado/llms.txt

Use this file to discover all available pages before exploring further.

The /predict/utp-risk endpoint evaluates a student’s current academic standing using six performance and engagement metrics and classifies them into one of three risk tiers. The RandomForest model combines the student’s running average, class attendance rate, task completion rate, participation score, weekly study hours, and the grade from the most recent practice exam to produce a composite academic risk score. The response includes confidence, a three-tier probability ranking, and personalised recommendations to help tutors and academic advisors intervene early.

Endpoint

POST http://localhost:8001/predict/utp-risk
Content-Type: application/json

Request Body

promedio_actual
float
required
Student’s current weighted average grade on the UTP 0–20 scale. Must be between 0.0 and 20.0.
asistencia_pct
float
required
Percentage of scheduled class sessions the student has attended. Must be between 0.0 and 100.0. Values below 75 trigger an attendance recommendation.
tareas_entregadas_pct
float
required
Percentage of assigned tasks submitted on time. Must be between 0.0 and 100.0. Values below 70 trigger a task-completion recommendation.
participacion_pct
float
required
Percentage of participation opportunities (questions, forums, live interactions) the student has engaged with. Must be between 0.0 and 100.0.
horas_estudio_semana
float
required
Average number of self-study hours per week reported or tracked for this student. Must be between 0.0 and 40.0. Values below 6 trigger a study-hours recommendation.
nota_pc_anterior
float
required
Grade obtained in the most recent practice exam (PC), on the UTP 0–20 scale. Must be between 0.0 and 20.0. Values below 12 trigger a revision recommendation.

Example Request

curl -X POST http://localhost:8001/predict/utp-risk \
  -H "Content-Type: application/json" \
  -d '{
    "promedio_actual": 9.5,
    "asistencia_pct": 62.0,
    "tareas_entregadas_pct": 55.0,
    "participacion_pct": 40.0,
    "horas_estudio_semana": 3.5,
    "nota_pc_anterior": 8.0
  }'

Example Response

{
  "caso": "UTP RiskAI",
  "prediccion": "RIESGO_ALTO",
  "confianza": 0.9211,
  "ranking": [
    { "clase": "RIESGO_ALTO",  "probabilidad": 0.9211 },
    { "clase": "RIESGO_MEDIO", "probabilidad": 0.0618 },
    { "clase": "RIESGO_BAJO",  "probabilidad": 0.0171 }
  ],
  "recomendaciones": [
    "Subir asistencia: el sistema detecta pérdida de continuidad académica.",
    "Regularizar entregas: las tareas evidencian práctica sostenida.",
    "Aumentar horas de práctica semanal con ejercicios guiados.",
    "Reforzar puntos débiles de la práctica anterior antes de la evaluación final."
  ],
  "entrada": {
    "promedio_actual": 9.5,
    "asistencia_pct": 62.0,
    "tareas_entregadas_pct": 55.0,
    "participacion_pct": 40.0,
    "horas_estudio_semana": 3.5,
    "nota_pc_anterior": 8.0
  }
}

Response Fields

caso
string
Human-readable model identifier. Always "UTP RiskAI" for this endpoint.
prediccion
string
The top predicted academic risk tier. One of:
LabelMeaning
RIESGO_ALTOHigh academic risk — immediate advisor intervention recommended
RIESGO_MEDIOModerate risk — monitor weekly and encourage targeted improvement
RIESGO_BAJOLow risk — student is on track; maintain current rhythm
confianza
float
Probability assigned to the top predicted risk class, in the range 0.0 to 1.0.
ranking
array of objects
Probability distribution across all three risk labels, sorted in descending order of probability.
recomendaciones
array of strings
Personalised academic recommendations derived from which specific thresholds were crossed in the input fields. If no thresholds are crossed (strong student), a single encouragement message is returned instead.
entrada
object
Echo of the validated request payload as parsed by Pydantic, useful for storing alongside the student record in your academic management system.
All grade fields (promedio_actual, nota_pc_anterior) use the UTP 0–20 grading scale. The passing threshold is 11. Scores below this level carry the highest individual weight in the model’s composite risk formula.

Build docs developers (and LLMs) love