Smart Stock 360 helps inventory managers decide when to reorder by classifying each product into one of three demand tiers. The model combines sales velocity, active discounts, seasonal context, product rating, and current coverage to produce an actionable label along with concrete replenishment recommendations.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.
Model Details
| Property | Value |
|---|---|
| Model key | smart-stock |
| Endpoint | POST /predict/smart-stock |
| Training samples | 300 synthetic samples |
| Classifier | RandomForestClassifier(n_estimators=180, max_depth=7, random_state=42, class_weight="balanced_subsample") |
Output Labels
| Label | Meaning |
|---|---|
DEMANDA_ALTA_REABASTECER | High demand, low coverage — restock urgently |
DEMANDA_MEDIA_MONITOREAR | Moderate demand — monitor and prepare a moderate order |
DEMANDA_BAJA_OPTIMIZAR | Low demand — reduce immediate purchase, avoid overstock |
Label Decision Logic
The labelling function computes two intermediate values before assigning a class:Input Fields
Current product price in local currency. Range: 1 – 5 000. Higher prices slightly decrease the demand score.
Units currently in stock. Range: 0 – 10 000. Used to calculate stock coverage relative to recent sales.
Units sold in the last 7 days. Range: 0 – 5 000. Primary driver of the demand score.
Active discount percentage on the product. Range: 0 – 90. A higher discount amplifies perceived demand.
Current season context. Range: 0 – 2.
0= normal period1= campaign / promotional period2= holiday / peak demand
Number of days since the last restock event. Range: 0 – 120. Longer gaps increase the demand score.
Product rating on a 1–5 scale. Range: 1 – 5. Higher ratings increase the demand score.
Recommendations by Label
| Label | Recommendations |
|---|---|
DEMANDA_ALTA_REABASTECER | Restock within 48 hours · Maintain promotion if margin allows · Display a red alert on the dashboard |
DEMANDA_MEDIA_MONITOREAR | Monitor daily sales · Prepare a moderate order if the season continues · Compare against substitute products |
DEMANDA_BAJA_OPTIMIZAR | Reduce immediate purchase · Evaluate a promotion or bundle · Avoid overstock and review pricing |
Example Request & Response
Response Fields
Always
"SmartStock360" for this endpoint.Predicted demand label:
DEMANDA_ALTA_REABASTECER, DEMANDA_MEDIA_MONITOREAR, or DEMANDA_BAJA_OPTIMIZAR.Probability of the top prediction, rounded to 4 decimal places.
All three demand classes sorted by probability descending. Each element contains
clase (string) and probabilidad (float).List of actionable replenishment recommendations for the predicted label.
Echo of the exact request payload that was received by the server.
The
cobertura (coverage) calculation is stock_actual / max(ventas_7d, 1). Sending ventas_7d = 0 will not cause a division-by-zero error — the denominator is clamped to 1.