File size: 429 Bytes
d64524a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import requests

url = 'http://localhost:9696/predict'

customer = { 
    "lead_source": "paid_ads", 
    "number_of_courses_viewed": 5, 
    "annual_income": 79450.0 
}

response = requests.post(url, json=customer)
predictions = response.json()

print(f"Respose: {predictions}")
if predictions['converted'] >= 0.5:
    print('Customer is likely to convert, send promo mails')
else:
    print('Customer is not likely to convert')