vijayendras commited on
Commit
319b613
·
verified ·
1 Parent(s): 4ba7573

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -29,23 +29,23 @@ def predict_sales():
29
  the predicted lead's outcome status as a JSON response.
30
  """
31
  # Get the JSON data from the request body
32
- data = request.get_json()
33
 
34
  # Extract relevant lead features from the input data
35
  sample = {
36
- 'Age': data['age'],
37
- 'Current_Occupation': data['current_occupation'],
38
- 'First_Interaction': data['first_interaction'],
39
- 'Profile_Completed': data['profile_completed'],
40
- 'Website_Visits': data['website_visits'],
41
- 'Time_Spent_on_Website': data['time_spent_on_website'],
42
- 'Page_Views_Per_Visit': data['page_views_per_visit'],
43
- 'Last_Activity': data['last_activity'],
44
- 'Print_Media_Type1': data['print_media_type1'],
45
- 'Print_Media_Type2': data['print_media_type2'],
46
- 'Digital_Media': data['digital_media'],
47
- 'Educational_Channels': data['educational_channels'],
48
- 'Referral': data['referral']
49
  }
50
 
51
  # Convert the extracted data into a Pandas DataFrame
 
29
  the predicted lead's outcome status as a JSON response.
30
  """
31
  # Get the JSON data from the request body
32
+ lead_data = request.get_json()
33
 
34
  # Extract relevant lead features from the input data
35
  sample = {
36
+ 'Age': lead_data['age'],
37
+ 'Current_Occupation': lead_data['current_occupation'],
38
+ 'First_Interaction': lead_data['first_interaction'],
39
+ 'Profile_Completed': lead_data['profile_completed'],
40
+ 'Website_Visits': lead_data['website_visits'],
41
+ 'Time_Spent_on_Website': lead_data['time_spent_on_website'],
42
+ 'Page_Views_Per_Visit': lead_data['page_views_per_visit'],
43
+ 'Last_Activity': lead_data['last_activity'],
44
+ 'Print_Media_Type1': lead_data['print_media_type1'],
45
+ 'Print_Media_Type2': lead_data['print_media_type2'],
46
+ 'Digital_Media': lead_data['digital_media'],
47
+ 'Educational_Channels': lead_data['educational_channels'],
48
+ 'Referral': lead_data['referral']
49
  }
50
 
51
  # Convert the extracted data into a Pandas DataFrame