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()
frame.head()
import matplotlib.pyplot as plt
plt.scatter(frame.august, frame.september)
plt.scatter(frame.august, frame["Scored Labels"], color="red")
plt.show()
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()