In [7]:
from azureml import Workspace
ws = Workspace()
experiment = ws.experiments['66e373b2084d4ffa9395c0e34ce9ccaa.f-id.f0b087218011447390975954f7a2e298']
ds = experiment.get_intermediate_dataset(
    node_id='fe362b6d-e207-474f-a974-9eb9ce72ac7a-4099',
    port_name='Results dataset',
    data_type_id='GenericCSV'
)
frame = ds.to_dataframe()
In [3]:
frame.head()
Out[3]:
ounasort august september Scored Labels
0 Liivi sibul 2.49 2.49 4.038499
1 Liivi sibul 0.73 1.79 2.401041
2 Liivi sibul 2.08 2.08 3.655316
3 Antoonovka 3.15 4.60 5.817976
4 Liivi sibul 2.62 3.43 4.160118
In [6]:
import matplotlib.pyplot as plt
plt.scatter(frame.august, frame.september)
plt.scatter(frame.august, frame["Scored Labels"], color="red")
plt.show()
In [12]:
import urllib.request
import json

osort=input("Palun õunasort")
augustidiameeter=input("Diameeter augustis")

data = {
        "Inputs": {
                "input1":
                [
                    {
                            'ounasort': osort,   
                            'august': augustidiameeter,   
                    }
                ],
        },
    "GlobalParameters":  {
    }
}

body = str.encode(json.dumps(data))

url = 'https://ussouthcentral.services.azureml.net/workspaces/66e373b2084d4ffa9395c0e34ce9ccaa/services/5d685b0843c849abbf9ed595f417c672/execute?api-version=2.0&format=swagger'
api_key = 'tcfaV8J2TDMmcQhweeaIeNosXlQKhfAqx8q3arAE/vkolMr/VFVq2qeNWHZpyVeXp0gOQIVU+OggMWZwob3Jgw==' # Replace this with the API key for the web service
headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)}

req = urllib.request.Request(url, body, headers)

try:
    response = urllib.request.urlopen(req)

    result = response.read()
    print(result)
    obj=json.loads(result.decode("utf8"))
    september=float(obj["Results"]["output1"][0]["Scored Labels"])
    print(september)
except urllib.error.HTTPError as error:
    print("The request failed with status code: " + str(error.code))

    # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure
    print(error.info())
    print(json.loads(error.read().decode("utf8", 'ignore')))
    

import matplotlib.pyplot as plt
plt.scatter(frame.august, frame.september)
plt.scatter(augustidiameeter, september, color="red")
plt.show()    
Palun õunasortAntoonovka
Diameeter augustis6
b'{"Results":{"output1":[{"ounasort":"Antoonovka","august":"6","Scored Labels":"8.7293643951416"}]}}'
8.7293643951416

image.png

image.png