Fraud Shield evaluates individual financial transactions in real time and classifies them into one of three risk levels. The model weighs transaction amount, time of day, previous failed attempts, customer history, device familiarity, country risk, and recent purchase frequency to generate an actionable risk label along with recommended next steps.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 | fraud-shield |
| Endpoint | POST /predict/fraud-shield |
| Training samples | 320 synthetic samples |
| Classifier | RandomForestClassifier(n_estimators=180, max_depth=7, random_state=42, class_weight="balanced_subsample") |
Output Labels
| Label | Meaning |
|---|---|
FRAUDE_PROBABLE | High-risk transaction — likely fraudulent, block immediately |
REVISION_MANUAL | Moderate risk — request additional customer verification |
TRANSACCION_SEGURA | Low risk — authorize and continue passive monitoring |
Label Decision Logic
The labelling function accumulates risk points from multiple signals before assigning a class:| Condition | Points added |
|---|---|
monto > 5 000 | +35 |
monto > 1 500 | +12 |
hora_24 <= 5 (late night) | +18 |
Each intentos_previos | +8 each |
antiguedad_cliente_meses < 3 | +18 |
antiguedad_cliente_meses < 12 | +8 |
dispositivo_nuevo == 1 | +20 |
pais_riesgo == 1 | +18 |
compras_ultima_hora > 5 | +12 |
Input Fields
Transaction amount in local currency. Range: 1 – 20 000. Amounts above 5 000 add 35 risk points; amounts above 1 500 add 12.
Hour of day the transaction was initiated (24-hour clock). Range: 0 – 23. Transactions between midnight and 05:00 add 18 risk points.
Number of previous failed authentication attempts for this transaction session. Range: 0 – 10. Each attempt adds 8 risk points.
Customer account age in months. Range: 0 – 120. Accounts younger than 3 months add 18 points; younger than 12 months add 8 points.
Whether the transaction originates from a device not previously seen for this account. Range: 0 – 1.
0= known device1= new / unrecognised device (+20 risk points)
Country risk classification for the transaction origin. Range: 0 – 1.
0= low-risk country1= high-risk country (+18 risk points)
Number of purchases made by this account in the last hour. Range: 0 – 20. More than 5 purchases add 12 risk points.
Recommendations by Label
| Label | Recommendations |
|---|---|
FRAUDE_PROBABLE | Block the operation temporarily · Request reinforced authentication · Log an alert for analyst review |
REVISION_MANUAL | Request additional customer confirmation · Compare against purchase history · Authorise only if verification succeeds |
TRANSACCION_SEGURA | Authorise the operation and continue passive monitoring |
Example Request & Response
Response Fields
Always
"FraudShield" for this endpoint.Predicted risk label:
FRAUDE_PROBABLE, REVISION_MANUAL, or TRANSACCION_SEGURA.Probability of the top prediction, rounded to 4 decimal places.
All three risk classes sorted by probability descending. Each element contains
clase (string) and probabilidad (float).List of recommended actions for the fraud analyst or automated system based on the predicted label.
Echo of the exact request payload received by the server.