Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
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 |
-
|
| 33 |
|
| 34 |
# Extract relevant lead features from the input data
|
| 35 |
sample = {
|
| 36 |
-
'Age':
|
| 37 |
-
'Current_Occupation':
|
| 38 |
-
'First_Interaction':
|
| 39 |
-
'Profile_Completed':
|
| 40 |
-
'Website_Visits':
|
| 41 |
-
'Time_Spent_on_Website':
|
| 42 |
-
'Page_Views_Per_Visit':
|
| 43 |
-
'Last_Activity':
|
| 44 |
-
'Print_Media_Type1':
|
| 45 |
-
'Print_Media_Type2':
|
| 46 |
-
'Digital_Media':
|
| 47 |
-
'Educational_Channels':
|
| 48 |
-
'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
|