SmartStock360’s AI service is a FastAPI application that hosts five scikit-learn Random Forest classifiers. All models are trained entirely in memory at startup from synthetic data — no external model files, databases, or checkpoints are required. Once the server is running, every endpoint is immediately ready to accept prediction requests.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.
Shared Classifier Configuration
Every model uses the sameRandomForestClassifier hyperparameters, ensuring consistent behaviour across all five domains:
balanced_subsample reweights classes at each bootstrap draw, which prevents majority-class dominance in the synthetic training sets. random_state=42 guarantees reproducible predictions on every server restart.
ModelPack Architecture
Each model is wrapped in aModelPack instance that bundles four things together:
features— ordered list of input feature nameslabels— list of string class namesmodel— the trainedRandomForestClassifierencoder— a fittedLabelEncodermapping integer indices back to label strings
predict() method accepts a Dict[str, float], builds a numpy row in feature order, runs inference, and returns a dictionary with three keys:
| Key | Type | Description |
|---|---|---|
label | str | Winning class name |
confidence | float | Probability of the winning class (0–1, 4 decimal places) |
ranking | list | All classes sorted by probability descending |
All Five Models at a Glance
| Model Key | Endpoint | Output Labels |
|---|---|---|
smart-stock | POST /predict/smart-stock | DEMANDA_ALTA_REABASTECER, DEMANDA_MEDIA_MONITOREAR, DEMANDA_BAJA_OPTIMIZAR |
fraud-shield | POST /predict/fraud-shield | FRAUDE_PROBABLE, REVISION_MANUAL, TRANSACCION_SEGURA |
cyber-sentinel | POST /predict/cyber-sentinel | CRITICO, ALTO, MEDIO, BAJO |
utp-risk | POST /predict/utp-risk | RIESGO_ALTO, RIESGO_MEDIO, RIESGO_BAJO |
talent-match | POST /predict/talent-match | FRONTEND_REACT, BACKEND_SPRING, DATA_ANALYST_JUNIOR, FULLSTACK_JUNIOR |
Common Response Shape
Every prediction endpoint returns the same JSON envelope, regardless of which model was called:| Field | Type | Description |
|---|---|---|
caso | string | Human-readable model name |
prediccion | string | Predicted class label |
confianza | float | Confidence score of the top prediction |
ranking | array | All classes with their individual probabilities |
recomendaciones | array | Actionable suggestions based on the predicted label |
entrada | object | Echo of the exact request payload received |
API Endpoints
The service exposes seven endpoints. Two utility endpoints are available immediately on startup; five prediction endpoints accept POST requests.GET /health
Returns a liveness check confirming that all five models loaded successfully.GET /metadata
Returns the ordered feature list and label list for every loaded model. Useful for programmatically validating request payloads before sending them.POST /predict/* (five endpoints)
Each prediction endpoint accepts the model-specific JSON body and returns the common response shape described below. See each model’s page for the full request schema and examples.| Endpoint | Model |
|---|---|
POST /predict/utp-risk | UTP Risk AI |
POST /predict/fraud-shield | Fraud Shield |
POST /predict/cyber-sentinel | Cyber Sentinel |
POST /predict/smart-stock | Smart Stock 360 |
POST /predict/talent-match | Talent Match AI |
Explore Each Model
Smart Stock 360
Inventory demand forecasting — classifies products into high, medium, or low demand tiers.
Fraud Shield
Real-time transaction risk classification across three risk levels.
Cyber Sentinel
Cybersecurity incident severity scoring from BAJO to CRITICO.
UTP Risk AI
Student academic performance risk prediction across three risk bands.
Talent Match AI
Developer skill profile classification into four tech career paths.