SimpleAzureML 1.0.3

Do you have problem to use Azure Machine Learing Web Service?

This SDK provides easy access for AMLWS on .NET based applications.

Install-Package SimpleAzureML -Version 1.0.3
dotnet add package SimpleAzureML --version 1.0.3
<PackageReference Include="SimpleAzureML" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleAzureML --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SimpleAzureML

.NET SDK for Azure Machine Learning Web Services (AMLWS)

NuGet version (SimpleAzureML)

Simple Azure Machine Learning SDK provides easy way how to use AMLWS. Via this SDK you can do Response-Request Service requests by few lines.

How to install package

Install with NuGet (recommended)

PM> Install-Package SimpleAzureML

Works for .NET applications

  • .NET Standard 2.0
  • .NET Framework 4.6.1
  • .NET Framework 4.6
  • .NET Framework 4.5.2
  • .NET Framework 4.5.1

Prerequisites

  • Newtonsoft.Json

Usage

Initialize SimpleAzure.Client

Create instance of SimpleAzure.Client, with arguments:

  • AMLWS's URL (looks like https://ussouthcentral.services.azureml.net/workspaces/xxxxxx/services/yyyyyyyy/execute?api-version=2.0&amp;format=swagger)
  • AMLWS's API key

sample code:

var simpleAzureMlClient = new SimpleAzureML.Client(
                "!----AMLWS-URL----!",
                "!----AMLWS-API-KEY----!"
                );

Request-Response Service request

Request model

RRS use RRSScoreGenericRequestModel for requests.
This model contains only key-value<string,object> pair inputs for web service.

sample code:

var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"myColumnString", "my string"},
                        {"myColumnInt", 2}
                    };
Do RRS requests

Single request

Use DoRRSRequest method of SimpleAzureML.Client with request as parameter.

sample code:


var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 22},
                        {"freeParkingSpacesCount", 0}
                    };
var response = await simpleAzureMlClient.DoRRSRequest(myRequest);

Multiple requests

You can combine more request in one call.
Use DoRRSRequest method of SimpleAzureML.Client with List of requests as parameter.

sample code:


var myRequests = new List<RRSScoreGenericRequestModel>();

var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 22},
                        {"freeParkingSpacesCount", 0}
                    };

myRequests.Add(myRequest);

var myRequest2 = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 23},
                        {"freeParkingSpacesCount", 0}
                    };                  
                    
myRequests.Add(myRequest2);


var response = await simpleAzureMlClient.DoRRSRequest(myRequests);
Response model

RRSScoreGenericResponseModel is used for response from RRS. Results from RRS endpoint are inside response.Results.Output1.

sample code:

 foreach (var myResponse in response.Results.Output1.Select((values, i) => new { i, values }))
            {

                Console.WriteLine("=== Result #" + myResponse.i);
                foreach(var myData in myResponse.values)
                {
                    Console.WriteLine("   "+ myData.Key +": " + myData.Value);
                }
            }

sample output:

=== Result #0
   freeParkingSpacesCount: 133
=== Result #1
   freeParkingSpacesCount: 118
=== Result #2
   freeParkingSpacesCount: 22

Batch Execution request

(Batch Execution requests support coming soon..)

SimpleAzureML

.NET SDK for Azure Machine Learning Web Services (AMLWS)

NuGet version (SimpleAzureML)

Simple Azure Machine Learning SDK provides easy way how to use AMLWS. Via this SDK you can do Response-Request Service requests by few lines.

How to install package

Install with NuGet (recommended)

PM> Install-Package SimpleAzureML

Works for .NET applications

  • .NET Standard 2.0
  • .NET Framework 4.6.1
  • .NET Framework 4.6
  • .NET Framework 4.5.2
  • .NET Framework 4.5.1

Prerequisites

  • Newtonsoft.Json

Usage

Initialize SimpleAzure.Client

Create instance of SimpleAzure.Client, with arguments:

  • AMLWS's URL (looks like https://ussouthcentral.services.azureml.net/workspaces/xxxxxx/services/yyyyyyyy/execute?api-version=2.0&amp;format=swagger)
  • AMLWS's API key

sample code:

var simpleAzureMlClient = new SimpleAzureML.Client(
                "!----AMLWS-URL----!",
                "!----AMLWS-API-KEY----!"
                );

Request-Response Service request

Request model

RRS use RRSScoreGenericRequestModel for requests.
This model contains only key-value<string,object> pair inputs for web service.

sample code:

var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"myColumnString", "my string"},
                        {"myColumnInt", 2}
                    };
Do RRS requests

Single request

Use DoRRSRequest method of SimpleAzureML.Client with request as parameter.

sample code:


var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 22},
                        {"freeParkingSpacesCount", 0}
                    };
var response = await simpleAzureMlClient.DoRRSRequest(myRequest);

Multiple requests

You can combine more request in one call.
Use DoRRSRequest method of SimpleAzureML.Client with List of requests as parameter.

sample code:


var myRequests = new List<RRSScoreGenericRequestModel>();

var myRequest = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 22},
                        {"freeParkingSpacesCount", 0}
                    };

myRequests.Add(myRequest);

var myRequest2 = new RRSScoreGenericRequestModel()
                    {
                        {"hour", 10},
                        {"minute", 23},
                        {"freeParkingSpacesCount", 0}
                    };                  
                    
myRequests.Add(myRequest2);


var response = await simpleAzureMlClient.DoRRSRequest(myRequests);
Response model

RRSScoreGenericResponseModel is used for response from RRS. Results from RRS endpoint are inside response.Results.Output1.

sample code:

 foreach (var myResponse in response.Results.Output1.Select((values, i) => new { i, values }))
            {

                Console.WriteLine("=== Result #" + myResponse.i);
                foreach(var myData in myResponse.values)
                {
                    Console.WriteLine("   "+ myData.Key +": " + myData.Value);
                }
            }

sample output:

=== Result #0
   freeParkingSpacesCount: 133
=== Result #1
   freeParkingSpacesCount: 118
=== Result #2
   freeParkingSpacesCount: 22

Batch Execution request

(Batch Execution requests support coming soon..)

Release Notes

added support for .NET Framework 4.5.1, added docs

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.3 240 4/24/2018
1.0.2 191 4/24/2018
1.0.1 209 4/24/2018
1.0.0 202 4/23/2018