-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_live_endpoint.py
More file actions
34 lines (29 loc) · 903 Bytes
/
test_live_endpoint.py
File metadata and controls
34 lines (29 loc) · 903 Bytes
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
import pandas as pd
from frogml_inference import RealTimeClient
JFROGML_MODEL_ID = 'churn_prediction_model'
if __name__ == '__main__':
# Define the data
feature_vector = [
{
'User_Id': 166056434,
'State': "AZ",
'Account_Length': 140,
'Area_Code': 408,
'Intl_Plan': 0,
'VMail_Plan': 0,
'VMail_Message': 0,
'Day_Mins': 149.8,
'Day_Calls': 134,
'Eve_Mins': 164.4,
'Eve_Calls': 98,
'Night_Mins' : 294.7,
'Night_Calls' : 124,
'Intl_Mins' : 8.1,
'Intl_Calls' : 2,
'CustServ_Calls' : 100,
'Agitation_Level' : 70
}]
input_ = pd.DataFrame(feature_vector)
client = RealTimeClient(model_id=JFROGML_MODEL_ID)
response = client.predict(input_)
print(response)