I have the same problem too
This was the code that was provided
endpoint = 'YOUR_ENDPOINT' #Replace with your endpoint
key = 'YOUR_KEY' #Replace with your key
import json
import requests
#An array of features based on five-day weather forecast
x = [[1,1,2022,1,0,6,0,2,0.344167,0.363625,0.805833,0.160446],
[2,1,2022,1,0,0,0,2,0.363478,0.353739,0.696087,0.248539],
[3,1,2022,1,0,1,1,1,0.196364,0.189405,0.437273,0.248309],
[4,1,2022,1,0,2,1,1,0.2,0.212122,0.590435,0.160296],
[5,1,2022,1,0,3,1,1,0.226957,0.22927,0.436957,0.1869]]
#Convert the array to JSON format
input_json = json.dumps({"data": x})
#Set the content type and authentication for the request
headers = {"Content-Type":"application/json",
"Authorization":"Bearer " + key}
#Send the request
response = requests.post(endpoint, input_json, headers=headers)
#If we got a valid response, display the predictions
if response.status_code == 200:
y = json.loads(response.json())
print("Predictions:")
for i in range(len(x)):
print (" Day: {}. Predicted rentals: {}".format(i+1, max(0, round(y["result"][i]))))
else:
print(response)
I have the same problem. This guide is faulty. The last end of this guide is the most important. it shows the resualt why this guide need. How to test our machine learning model. The guide is https://learn.microsoft.com/en-us/learn/modules/use-automated-machine-learning/7-deploy-model
Please, help someone :)
@Yazeed Shaker @Anastasiia A Volkova @katherine @Fernando José Ribeiro Júnior
I have reported this MS Learn issue to MS Learn team for you guys, you can also report this issue from this page, you need to scroll down to the bottom: https://learn.microsoft.com/en-us/learn/support/troubleshooting?uid=learn.wwl.use-automated-machine-learning.deploy-model&documentId=66bae982-ea84-44d3-0084-584e99cb37cb&versionIndependentDocumentId=95affaf1-e325-14a5-756c-3c122d316d68&contentPath=%2FMicrosoftDocs%2Flearn-pr%2Fblob%2Flive%2Flearn-pr%2Fwwl-data-ai%2Fuse-automated-machine-learning%2F7-deploy-model.yml&url=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Flearn%2Fmodules%2Fuse-automated-machine-learning%2F7-deploy-model&author=gmalc#report-feedback
Regards,
Yutong