An Azure machine learning service for building and deploying models.
OK, I will.
Thank you for your support > @Rohit Mungi
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have loaded bankmarketing_train.csv to get a dataset and auto generated a model to predict "y" field value with AutoML.
Voting Ensemble model was generated as the best model and tested its behavior after deployed to the endpoint.
Schema is generated like this for the endpoint.
Tried with the endpoint test feature in ML Studio. It worked and responded an expected output (left side in the fig below).
But my python REST call fails with 502 Bad Gateway(right side)
Using the REST plug-in for VSCode, I have requested as below. This also failed with the same response status code.
POST http://d8e9f6ad-4112-4417-97c0-01b4246b284a.japaneast.azurecontainer.io/score
Content-Type: application/json
Authorization: Bearer === My correct key here ===
{"data": [{"age": 87, "campaign": 1, "cons.conf.idx": -46.2, "cons.price.idx": 92.893, "contact": "cellular", "day_of_week": "mon", "default": "no", "duration": 471, "education": "university.degree", "emp.var.rate": -1.8, "euribor3m": 1.299, "housing": "yes", "job": "blue-collar", "loan": "yes", "marital": "married", "month": "may", "nr.employed": 5099.1, "pdays": 999, "poutcome": "failure", "previous": 1}]}
Investigated in the App Insight and queried the exceptions.
I found this end point tries to convert 'yes' to int value. Of course it fails.
The value 'yes' is set to 'loan' and 'housing". Both are defined string value in the swagger.json for this endpoint.
What do you think?
Am I missing something?
Is this a bug with the endpoint?
An Azure machine learning service for building and deploying models.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted commentComments have been turned off. Learn more
OK, I will.
Thank you for your support > @Rohit Mungi
I got a response from MS together with a workaround. I have confirmed the workaround is effective in this case.
The order of keys should be the same as the one defined in the model schema.
After I update the data definition in my client python file, it starts working.
data = {"data":
[
{
"age": 17,
"job": "blue-collar",
"marital": "married",
"education": "university.degree",
"default": "no",
"housing": "yes",
"loan": "yes",
"contact": "cellular",
"month": "may",
"day_of_week": "mon",
"duration": 971,
"campaign": 1,
"pdays": 999,
"previous": 1,
Thank you.
We just ran into this issue as well. Found out that the order of properties in the "data" structure must match exactly with the order of columns in the dataset.
This does not make sense to me, since the property names are passed in the json, why would the order matter also?
On top of that, we use C#, and the example code generated in the Azure ML Portal looks like:
using (var client = new HttpClient(handler))
{
// Request data goes here
var scoreRequest = new Dictionary<string, List<Dictionary<string, string>>>()
{
{
"data",
new List<Dictionary<string, string>>()
{
new Dictionary<string, string>()
{
This uses a Dictionary for the properties, but the order of elements in a C# Dictionary is undefined and it does not guarantee the order when reading elements from it.
So the generated/example C# code is prone to errors.
Is this a known issue? Or am I missing something here?
Thanks in advance!