-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpredict_request.ps1
More file actions
28 lines (25 loc) · 922 Bytes
/
predict_request.ps1
File metadata and controls
28 lines (25 loc) · 922 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
# Define the API endpoint URL
$apiUrl = "http://127.0.0.1:5000/predict"
# Create the test data payload as a JSON object
$testData = @{
"number_of_riders" = 50
"number_of_drivers" = 30
"number_of_past_rides" = 15
"average_ratings" = 4.5
"expected_ride_duration" = 60
"demand_supply_ratio" = 1.0
"location_category_Suburban" = 1
"location_category_Urban" = 0
"customer_loyalty_status_Regular" = 0
"customer_loyalty_status_Silver" = 0
"time_of_booking_Evening" = 1
"time_of_booking_Morning" = 0
"time_of_booking_Night" = 0
"vehicle_type_Premium" = 0
"duration_ratings_interaction" = 4.5
} | ConvertTo-Json -Depth 2
# Make a POST request to the API
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $testData -ContentType "application/json"
# Print the response
Write-Output "Response from the API:"
Write-Output $response