Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Esteban-Mendez-j/Proyecto-Docker/llms.txt

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

The prediction endpoint runs a machine-learning model against a candidate’s profile and a specific vacancy to produce a numeric match score. The model compares education level, years of experience, and twelve skill aptitudes to determine how closely the candidate fits the role. When a candidate has a complete profile, the vacancy listing also uses these scores to sort the most relevant positions to the top.

Endpoint

Evaluate candidate–vacancy match

GET /api/prediccion/evaluar/{nvacantes}
Cookie: jwtToken=<token>
nvacantes
integer
required
The numeric ID of the vacancy to evaluate against the authenticated candidate.
Auth — requires the jwtToken cookie. The candidate’s ID is extracted from the JWT; the endpoint is intended for users with the CANDIDATO role. Response body
resultadoPrediccion
string
Raw output from the Weka classifier. "0.0" indicates the model predicts no match; "1.0" indicates a predicted match.
porcentajeMatch
number
Percentage of the vacancy’s required aptitudes that the candidate also holds (0–100). Calculated as (matchedAptitudes / totalVacancyAptitudes) * 100. Returns 0 when the vacancy lists no aptitudes.
cantidadCoincidencias
integer
Number of aptitudes that the candidate and vacancy share.
totalAptitudes
integer
Total number of aptitudes required by the vacancy.
Example response
{
  "resultadoPrediccion": "1.0",
  "porcentajeMatch": 75.0,
  "cantidadCoincidencias": 3,
  "totalAptitudes": 4
}
Error response
{
  "mensaje": "Candidato o vacante no encontrados."
}
CodeMeaning
200Prediction completed successfully.
500An error occurred (missing candidate/vacancy, model failure). The mensaje field contains the exception message.

curl example

curl -X GET "https://your-host/api/prediccion/evaluar/42" \
  -H "Cookie: jwtToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

How the model works

The prediction pipeline runs in three stages: profile comparison, feature assembly, and classification.

1. Profile comparison

PrediccionService.comparacion() compares the candidate’s aptitude list against the vacancy’s aptitude list across twelve fixed skills:
AptitudeFeature name
Critical thinkingPensamientoCritico
CreativityCreatividad
Attention to detailAtencionDetalle
Continuous learningAprendizajeContinuo
Professional ethicsEticaProfesional
AutonomyAutonomia
ResponsibilityResponsabilidad
LeadershipLiderazgo
AdaptabilityAdaptabilidad
Problem solvingResolucionProblemas
Effective communicationComunicacionAfectiva
TeamworkTrabajoEquipo
Each feature is set to 1 if both the candidate and the vacancy include that aptitude, otherwise 0. CantidadAptitudes holds the total number of matches.

2. Feature assembly

The service builds a Weka Instance with these attributes, in order:
IndexAttributeTypeValues
0NivelEducativoNominalPostgrado, Técnico, Bachiller, Doctorado
1classNominal (target)0, 1
2AñosExperienciaNumericInteger from candidato.experiencia
3–14Twelve aptitude featuresNominal0 or 1
15CantidadAptitudesNumeric0–12

3. Classification

WekaWrapper is an auto-generated classifier wrapping a Weka J48 decision tree (trained with Weka 3.8.6, minimum 20 instances per leaf). The tree uses CantidadAptitudes as its primary split, then branches on individual aptitude flags, education level, and years of experience to assign a binary class (0 = no match, 1 = match). The raw double returned by classifyInstance is converted to a string ("0.0" or "1.0") and returned in resultadoPrediccion.

Profile completeness requirement

The ML-powered vacancy sorting is only active when a candidate’s profile is complete. A profile is considered complete when all three of the following fields are non-empty: nivelEducativo (education level), aptitudes (at least one aptitude), and experiencia (years of experience as a parseable integer).Candidates who have not filled in these fields will still see the vacancy list, but results will not be sorted by prediction score.
The same three fields are required to call the /api/prediccion/evaluar/{nvacantes} endpoint successfully. If any of them are missing or blank, PrediccionService.predecirDesdeComparacion will fail when it attempts to parse candidato.experiencia or read candidato.nivelEducativo.

Match score update on application

When a candidate submits or updates a job application, PrediccionService.actualizarAfinidad() iterates over all of the candidate’s existing Postulado records and re-runs the prediction for each vacancy. The resulting porcentajePrediccion is persisted on the Postulado entity so that application lists can be ranked by fit.

Build docs developers (and LLMs) love