API 文档

基础 URL

http://39.97.61.94:5000

健康检查

GET /health — 返回服务状态。

curl http://39.97.61.94:5000/health

销量预测

POST /predict — 传入特征数组,返回预测销量。

请求体

{
    "features": [float1, float2, ..., float23],
    "model": "tuned"   // 可选,默认 tuned;可选值 "v2" 使用31维模型
}

响应

{
    "prediction_raw": 0.42,
    "model_used": "tuned"
}

示例

curl -X POST http://39.97.61.94:5000/predict \\\\
  -H "Content-Type: application/json" \\\\
  -d '{"features": [0.1]*23}'

错误处理

返回 400 表示请求格式错误,500 表示服务器内部错误。错误信息在 error 字段中。