def setUp(self): self.workspace = Workspace( settings.workspace.id, settings.workspace.token, settings.workspace.endpoint )
authorization_token = ws.authorization_token print(workspace_id) print(authorization_token) # COMMAND ---------- from azureml import services # COMMAND ---------- # set up web service workspace_id = '9fe8f2f9e9f94677abc6d076340fcbf7' authorization_token = 'ghRbG40tVVy8IUGRYaPAo7cam6Nkv6Bn9qha4guFm0rhaiPHFGOaBD3xajad8o+h+baNRCFXaXT5qz9M1VpbGg==' ws = Workspace( workspace_id='fa817a79ba3b4cac86eb053ed001a566', authorization_token= '/KQWsvqg0dtfp3vOjiazPEWABxFni41TXHjYcvRMhqRquP2hqO36uZ4Q/tqHaq+G7nMDJB668hmOvMle4lm/Ew==', endpoint='https://studioapi.azureml-int.net') from azureml import services @services.publish(workspace_id, authorization_token) @services.types(a=float, b=float, c=float, d=float) @services.returns(float) def demoservice(a, b, c, d): # predict the label feature_vector = [a, b, c, d] return clf.predict(feature_vector) # COMMAND ----------
#import workspace from Azure, set up the data frame from azureml import Workspace ws = Workspace() experiment = ws.experiments['aad1200b3a5a422d8e75a41f9fcc1299.f-id.a8cddcb61b594851ad21466102f6e92f'] ds = experiment.get_intermediate_dataset( node_id='21e15cc1-15b7-4bc4-8f93-923ea9fe55e3-207', port_name='Results dataset', data_type_id='GenericCSV' ) frame = ds.to_dataframe() #visualize the data to plot every point against every point %matplotlib inline import seaborn as sns num_cols = ["mood (num)","sleep","sleep (2)","miles","total cal"] sns.pairplot(frame[num_cols], size=2)
""" AzureML Python client library wrapper Reference: https://github.com/Azure/Azure-MachineLearning-ClientLibrary-Python """ import os import pandas as pd from azureml import Workspace, AzureMLConflictHttpError from azureml.serialization import DataTypeIds ws = Workspace(workspace_id='a960dea614c04cf4a758c6321b857eb8', authorization_token='f527e8b37a58455494c08be5831119aa', endpoint='https://europewest.studio.azureml.net/') def symbol_to_path(symbol, base_dir=""): """Return CSV file path given ticker symbol""" return os.path.join(base_dir, "{}.csv".format(str(symbol))) def read_ds(symbol): print 'Reading ' + symbol + ' from server' ds = ws.datasets[symbol_to_path(symbol)] df_temp = ds.to_dataframe() df_temp = df_temp.loc[:, ['Date', 'Adj Close']].rename( columns={'Adj Close': symbol}) df_temp.set_index('Date', inplace=True) df_temp.fillna('nan') return df_temp
#!pip install azureml-sdk #Azure Machine Learning Extension for VS Code from azureml import Workspace, Datastore ws = Workspace.create(name='aml-workspace', subscription_id='123456-abc-123...', resource_group='aml-resources', create_resource_group=True, location='eastus', sku='enterprise' ) ws = Workspace() ws = Workspace.from_config() datastore = ws.get_default_datastore() blobstore = Datastore(ws,'name') filestore = Datastore(ws,'name') blobstore.get_default(ws).upload_files(["array of files"]) ds = ws.datasets['*.csv'] df = ds.to_dataframe() for compute_name in ws.compute_targets: compute = ws.compute_targets[compute_name] print(compute.name, ":", compute.type) #ws.name