none
Azure machine learning web service issue RRS feed

  • Question

  • Hi,

    I am using Ms azure ML studio. I have created one experiment where I am using K-means clustering to divide my data into cluster. I have set the No. of clusters as a web service parameter. I am deploying the web service and using the C# code to consume this created web service by using the generated key.

    However, when I pass the value for "No of cluster" in a global parameter, the output does not show the result as per the value set for Global parameter programmatic. It shows the output as per the no of cluster set in the model.

    Could you please help me how can I get result as per the value set in the global parameter for the no. of cluster.

    Thanks!


    • Edited by vikas dugi Monday, October 14, 2019 6:49 AM
    Monday, October 14, 2019 6:47 AM

Answers

  • Hi,

    Thank you for this information. Yes, I understand the issue you’re describing, but you haven’t presented the output you received. Did you deploy as predictive experiment? If so, then you should include only your input data for prediction. If you’re trying to create new clusters each time based on input data, then I suggest you deploy the training experiment instead. If the latter is the case, please share your output since I couldn’t reproduce this issue. I encourage you to review the documentation as well as other examples of how K-means clustering is used in Azure Machine Learning. Hope this helps. Please let me know if you have further questions. Thanks.

    Here’s an example of the output I received using the trained experiment:

    Clusters=3

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Assignments

    1

    0.833333333

    0.5

    0

    setosa

    0

    0.6

    0

    0.5

    0

    setosa

    1

    0.2

    0.333333333

    0

    0

    setosa

    2

    0

    0.166666667

    1

    0

    setosa

    1

    0.8

    1

    0.5

    0

    setosa

    0

    Clusters=2

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Assignments

    1

    0.833333333

    0.5

    0

    setosa

    0

    0.6

    0

    0.5

    0

    setosa

    1

    0.2

    0.333333333

    0

    0

    setosa

    1

    0

    0.166666667

    1

    0

    setosa

    1

    0.8

    1

    0.5

    0

    setosa

    0

    Regards,

    GiftA-MSFT.

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Saturday, October 19, 2019 12:36 AM
    Moderator

All replies

  • Hi,

     

    Can you please provide an example of what the current output is and what you expect? Also, providing details on the structure of your experiment would be helpful so we can understand the problem. Thanks.

     

     

    Regards,

    GiftA-MSFT.

     

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Tuesday, October 15, 2019 5:32 PM
    Moderator
  • You can refer below link for similar question:

    https://gallery.azure.ai/Experiment/K-means-clustering

    Thanks,

    Wednesday, October 16, 2019 5:39 AM
  • Hi,

    I ran multiple experiments and retrieved expected outputs (number of assigned clusters). Can you share a screenshot of your input parameter and output? Thanks.

    Regards,

    GiftA-MSFT.

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Friday, October 18, 2019 12:51 AM
    Moderator
  • Thank you for the reply GiftA-MSFT

    I am using the following sample experiment in which k-means clustering is using. https://gallery.azure.ai/Experiment/K-means-clustering

    I am deploying the web service for the above sample experiment. In this experiment they are clustering the flower into number of groups (i.e. no. of clusters). In the experiment suppose we set the No. of cluster as 3 then the output will be return for 3 groups and in web service we pass the global parameter for no. of cluster as 2 programmatically then I expect this will return 2 groups. However, when I execute the web service then also I get the output as 3 no. of groups, it should return 2 no. of groups. I am trying the same on MS azure ML studio trial. Please find my web service request as below

    const string apiKey = "API key for the web service"
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
    client.BaseAddress = new Uri("https://ussouthcentral.services.azureml.net/workspaces/6f7e22f96f3a404c81101b5b6011c0c2/services/f6e73a64cd2c4c51a4073cc277d4ed66/execute?api-version=2.0&details=true");


    Hope this helps to clear my problem. J



    • Edited by vikas dugi Friday, October 18, 2019 1:36 PM
    Friday, October 18, 2019 1:21 PM
  • Hi,

    Thank you for this information. Yes, I understand the issue you’re describing, but you haven’t presented the output you received. Did you deploy as predictive experiment? If so, then you should include only your input data for prediction. If you’re trying to create new clusters each time based on input data, then I suggest you deploy the training experiment instead. If the latter is the case, please share your output since I couldn’t reproduce this issue. I encourage you to review the documentation as well as other examples of how K-means clustering is used in Azure Machine Learning. Hope this helps. Please let me know if you have further questions. Thanks.

    Here’s an example of the output I received using the trained experiment:

    Clusters=3

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Assignments

    1

    0.833333333

    0.5

    0

    setosa

    0

    0.6

    0

    0.5

    0

    setosa

    1

    0.2

    0.333333333

    0

    0

    setosa

    2

    0

    0.166666667

    1

    0

    setosa

    1

    0.8

    1

    0.5

    0

    setosa

    0

    Clusters=2

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Assignments

    1

    0.833333333

    0.5

    0

    setosa

    0

    0.6

    0

    0.5

    0

    setosa

    1

    0.2

    0.333333333

    0

    0

    setosa

    1

    0

    0.166666667

    1

    0

    setosa

    1

    0.8

    1

    0.5

    0

    setosa

    0

    Regards,

    GiftA-MSFT.

    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Saturday, October 19, 2019 12:36 AM
    Moderator
  • Thank you GiftA-MSFT.

    Training experiment worked for me to pass dynamics no. of cluster in web service programmatically as a global parameter instead of predictive experiment.

    Thank You.

    Thursday, October 31, 2019 10:35 AM