File size: 1,049 Bytes
575d22a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: Hotel Booking Cancellation Prediction API
emoji: 🏨
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
license: mit
---

# Hotel Booking Cancellation Prediction API

This is a FastAPI-based prediction service that estimates the probability of hotel booking cancellations.

## Features

- **POST /predict** - Predict cancellation probability for a single booking
- **GET /health** - Health check endpoint
- **GET /** - API information

## Example Usage

```python
import requests

payload = {
    "lead_time": 30,
    "arrival_month": 7,
    "adults": 2,
    "children": 0,
    "adr": 120.0
}

response = requests.post("https://huggingface.co/spaces/j2damax/boking-cancelation-api/predict", json=payload)
print(response.json())
```

## Model Information

The API uses a machine learning model trained on hotel booking data with features like:
- Lead time (days before arrival)
- Guest composition (adults, children)
- Pricing (average daily rate)
- Stay duration
- And more...

Check `/docs` for the interactive API documentation.