Spaces:
Sleeping
Sleeping
File size: 732 Bytes
07e37a4 | 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 | import requests
url = "http://127.0.0.1:8000/predict"
sample_data = {
"gender": "Male",
"SeniorCitizen": 0,
"Partner": "Yes",
"Dependents": "No",
"tenure": 5,
"PhoneService": "Yes",
"MultipleLines": "No",
"InternetService": "Fiber optic",
"OnlineSecurity": "No",
"OnlineBackup": "Yes",
"DeviceProtection": "No",
"TechSupport": "No",
"StreamingTV": "Yes",
"StreamingMovies": "Yes",
"Contract": "Month-to-month",
"PaperlessBilling": "Yes",
"PaymentMethod": "Electronic check",
"MonthlyCharges": 70.35,
"TotalCharges": 350.75
}
response = requests.post(url, json=sample_data)
print("Status Code:", response.status_code)
print("Response:", response.json())
|