assets/promptflow/data/faiss-index-lookup/faiss_index_sample/index.pkl (280 lines of code) (raw):

�����langchain.docstore.in_memory��InMemoryDocstore���)��}��_dict�}�(�$5520fbd6-18d0-4175-9b83-434152b223c4��langchain.schema��Document���)��}�(�__dict__�}�(� page_content�X�Quickstart: Get started with Azure Machine Learning - Azure Machine Learning | Microsoft Learn Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Download Microsoft Edge More info about Internet Explorer and Microsoft Edge Table of contents Exit focus mode Read in English Save Table of contents Read in English Save Edit Print Twitter LinkedIn Facebook Email Table of contents Quickstart: Get started with Azure Machine Learning Article 04/20/2023 8 contributors Feedback In this article APPLIES TO : Python SDK azure-ai-ml v2 (current) This tutorial is an introduction to some of the most used features of the Azure Machine Learning service. In it, you will create, register and deploy a model. This tutorial will help you become familiar with the core concepts of Azure Machine Learning and their most common usage. You'll learn how to run a training job on a scalable compute resource, then deploy it,��metadata�}�(�title��tutorial-azure-ml-in-a-day��source��Shttps://learn.microsoft.com/en-us/azure/machine-learning/tutorial-azure-ml-in-a-day�uu�__fields_set__���(hh��__private_attribute_values__�}�ub�$7abc5579-dd4e-4828-8036-a4bad9accd7d�h )��}�(h }�(hXand finally test the deployment. You'll create a training script to handle the data preparation, train and register a model. Once you train the model, you'll deploy it as an endpoint , then call the endpoint for inferencing . The steps you'll take are: Set up a handle to your Azure Machine Learning workspace Create your training script Create a scalable compute resource, a compute cluster Create and run a command job that will run the training script on the compute cluster, configured with the appropriate job environment View the output of your training script Deploy the newly-trained model as an endpoint Call the Azure Machine Learning endpoint for inferencing Watch this video for an overview of the steps in this quickstart. Prerequisites To use Azure Machine Learning, you'll first need a workspace. If you don't have one, complete Create resources you need to get started to create a workspace and learn more about using it. Sign in to studio and select your workspace if it's not already open. Open or create a�hhuh��(hh�h}�ub�$533e0b4c-8660-4a6d-8025-97f0a4609662�h )��}�(h }�(hX�notebook in your workspace: Create a new notebook , if you want to copy/paste code into cells. Or, open tutorials/get-started-notebooks/quickstart.ipynb from the Samples section of studio. Then select Clone to add the notebook to your Files . ( See where to find Samples .) Set your kernel On the top bar above your opened notebook, create a compute instance if you don't already have one. If the compute instance is stopped, select Start compute and wait until it is running. Make sure that the kernel, found on the top right, is Python 3.10 - SDK v2 . If not, use the dropdown to select this kernel. If you see a banner that says you need to be authenticated, select Authenticate . Important The rest of this tutorial contains cells of the tutorial notebook. Copy/paste them into your new notebook, or switch to the notebook now if you cloned it. Create handle to workspace Before we dive in the code, you need a way to reference your workspace. The workspace is the top-level resource for Azure Machine Learning,�hhuh��(hh�h}�ub�$5f10694a-1015-44e8-b3f3-87c27ca8d579�h )��}�(h }�(hXiproviding a centralized place to work with all the artifacts you create when you use Azure Machine Learning. You'll create ml_client for a handle to the workspace. You'll then use ml_client to manage resources and jobs. In the next cell, enter your Subscription ID, Resource Group name and Workspace name. To find these values: In the upper right Azure Machine Learning studio toolbar, select your workspace name. Copy the value for workspace, resource group and subscription ID into the code. You'll need to copy one value, close the area and paste, then come back for the next one. from azure.ai.ml import MLClient�hhuh��(hh�h}�ub�$bedd7e74-d7fb-4eee-a5ac-098290a812b2�h )��}�(h }�(h�1from azure.identity import DefaultAzureCredential�hhuh��(hh�h}�ub�$b1cf5292-aad0-4646-b81a-cf4135307182�h )��}�(h }�(hX�# authenticate credential = DefaultAzureCredential() # Get a handle to the workspace ml_client = MLClient( credential=credential, subscription_id="<SUBSCRIPTION_ID>", resource_group_name="<RESOURCE_GROUP>", workspace_name="<AML_WORKSPACE_NAME>", ) Note Creating MLClient will not connect to the workspace. The client initialization is lazy, it will wait for the first time it needs to make a call (in this notebook, that will happen in the cell that creates the compute cluster). Create training script Let's start by creating the training script - the main.py Python file. First create a source folder for the script: import os�hhuh��(hh�h}�ub�$91861a22-c725-4069-b784-270552cabb6b�h )��}�(h }�(hX�train_src_dir = "./src" os.makedirs(train_src_dir, exist_ok=True) This script handles the preprocessing of the data, splitting it into test and train data. It then consumes this data to train a tree based model and return the output model. MLFlow will be used to log the parameters and metrics during our pipeline run. The cell below uses IPython magic to write the training script into the directory you just created. %%writefile {train_src_dir}/main.py import os import argparse import pandas as pd import mlflow import mlflow.sklearn from sklearn.ensemble import GradientBoostingClassifier from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split def main(): """Main function of the script."""�hhuh��(hh�h}�ub�$00e7f30b-f2f6-421d-b156-900180f25926�h )��}�(h }�(hX�# input and output arguments parser = argparse.ArgumentParser() parser.add_argument("--data", type=str, help="path to input data") parser.add_argument("--test_train_ratio", type=float, required=False, default=0.25) parser.add_argument("--n_estimators", required=False, default=100, type=int) parser.add_argument("--learning_rate", required=False, default=0.1, type=float) parser.add_argument("--registered_model_name", type=str, help="model name") args = parser.parse_args() # Start Logging mlflow.start_run() # enable autologging mlflow.sklearn.autolog() ################### #<prepare the data> ################### print(" ".join(f"{k}={v}" for k, v in vars(args).items())) print("input data:", args.data) credit_df = pd.read_csv(args.data, header=1, index_col=0) mlflow.log_metric("num_samples", credit_df.shape[0]) mlflow.log_metric("num_features", credit_df.shape[1] - 1)�hhuh��(hh�h}�ub�$25d1d9ea-486d-40ea-9157-545c5a9757b4�h )��}�(h }�(hX�train_df, test_df = train_test_split( credit_df, test_size=args.test_train_ratio, ) #################### #</prepare the data> #################### ################## #<train the model> ################## # Extracting the label column y_train = train_df.pop("default payment next month") # convert the dataframe values to array X_train = train_df.values # Extracting the label column y_test = test_df.pop("default payment next month") # convert the dataframe values to array X_test = test_df.values print(f"Training with data of shape {X_train.shape}") clf = GradientBoostingClassifier( n_estimators=args.n_estimators, learning_rate=args.learning_rate ) clf.fit(X_train, y_train) y_pred = clf.predict(X_test) print(classification_report(y_test, y_pred)) ################### #</train the model> ###################�hhuh��(hh�h}�ub�$b53f28c0-1b4a-4ac8-a715-fdb5bb715e8b�h )��}�(h }�(hX�########################## #<save and register model> ########################## # Registering the model to the workspace print("Registering the model via MLFlow") mlflow.sklearn.log_model( sk_model=clf, registered_model_name=args.registered_model_name, artifact_path=args.registered_model_name, ) # Saving the model to a file mlflow.sklearn.save_model( sk_model=clf, path=os.path.join(args.registered_model_name, "trained_model"), ) ########################### #</save and register model> ########################### # Stop Logging mlflow.end_run()�hhuh��(hh�h}�ub�$20550454-3687-482c-a1f2-5537c4797760�h )��}�(h }�(h�if __name__ == "__main__":�hhuh��(hh�h}�ub�$c0120aba-ff12-439d-8e89-be46dd5e76f4�h )��}�(h }�(hX�main() As you can see in this script, once the model is trained, the model file is saved and registered to the workspace. Now you can use the registered model in inferencing endpoints. You might need to select Refresh to see the new folder and script in your Files . Create a compute cluster, a scalable way to run a training job Note To try serverless compute (preview) , skip this step and proceed to configure the command . You already have a compute instance, which you're using to run the notebook. Now you'll add a second type of compute, a compute cluster that you'll use to run your training job. While a compute instance is a single node machine, a compute cluster can be single or multi-node machines with Linux or Windows OS, or a specific compute fabric like Spark. You'll provision a Linux compute cluster. See the full list on VM sizes and prices . For this example, you only need a basic cluster, so you'll use a Standard_DS3_v2 model with 2 vCPU cores, 7-GB RAM. from azure.ai.ml.entities import�hhuh��(hh�h}�ub�$c91106cb-7b34-4009-87fa-9deb0c929641�h )��}�(h }�(h� AmlCompute�hhuh��(hh�h}�ub�$e08da9f6-7fde-47bd-9c83-d34f9f0b1903�h )��}�(h }�(hXn# Name assigned to the compute cluster cpu_compute_target = "cpu-cluster" try: # let's see if the compute target already exists cpu_cluster = ml_client.compute.get(cpu_compute_target) print( f"You already have a cluster named {cpu_compute_target}, we'll reuse it as is." ) except Exception: print("Creating a new cpu compute target...")�hhuh��(hh�h}�ub�$f37c5f0f-77f1-4dfd-8e9f-1c46ae9c6d11�h )��}�(h }�(hX�# Let's create the Azure Machine Learning compute object with the intended parameters # if you run into an out of quota error, change the size to a comparable VM that is available.\ # Learn more on https://azure.microsoft.com/en-us/pricing/details/machine-learning/. cpu_cluster = AmlCompute( name=cpu_compute_target, # Azure Machine Learning Compute is the on-demand VM service type="amlcompute", # VM Family size="STANDARD_DS3_V2", # Minimum running nodes when there is no job running min_instances=0, # Nodes in cluster max_instances=4, # How many seconds will the node running after the job termination idle_time_before_scale_down=180, # Dedicated or LowPriority. The latter is cheaper but there is a chance of job termination tier="Dedicated", ) print( f"AMLCompute with name {cpu_cluster.name} will be created, with compute size {cpu_cluster.size}" )�hhuh��(hh�h}�ub�$46bffc43-1c3d-4c7b-b82c-57a71651cbbc�h )��}�(h }�(h�?# Now, we pass the object to MLClient's create_or_update method�hhuh��(hh�h}�ub�$94fe8164-b00a-4333-9f07-b8c17d1ec947�h )��}�(h }�(hX�cpu_cluster = ml_client.compute.begin_create_or_update(cpu_cluster) Configure the command Now that you have a script that can perform the desired tasks, and a compute cluster to run the script, you'll use a general purpose command that can run command line actions. This command line action can directly call system commands or run a script. Here, you'll create input variables to specify the input data, split ratio, learning rate and registered model name. The command script will: Use the compute cluster to run the command. Use an environment that defines software and runtime libraries needed for the training script. Azure Machine Learning provides many curated or ready-made environments, which are useful for common training and inference scenarios. You'll use one of those environments here. In the Train a model tutorial, you'll learn how to create a custom environment. Configure the command line action itself - python main.py in this case. The inputs/outputs are accessible in the command via the ${{ ...�hhuh��(hh�h}�ub�$077f8080-9234-4c11-8aef-a288b311f181�h )��}�(h }�(h��}} notation. In this sample, we access the data from a file on the internet. Note To use serverless compute (preview) , delete compute="cpu-cluster" in this code. Serverless is the simplest way to run jobs on AzureML. from azure.ai.ml import command�hhuh��(hh�h}�ub�$36f075ed-2353-4be3-b5ee-65c10bc78082�h )��}�(h }�(h�from azure.ai.ml import Input�hhuh��(hh�h}�ub�$cde7f3b5-00f6-45ff-85df-82002ca36a0f�h )��}�(h }�(h�/registered_model_name = "credit_defaults_model"�hhuh��(hh�h}�ub�$79f34270-1edc-43de-8368-7d07e29619a8�h )��}�(h }�(hX�job = command( inputs=dict( data=Input( type="uri_file", path="https://azuremlexamples.blob.core.windows.net/datasets/credit_card/default_of_credit_card_clients.csv", ), test_train_ratio=0.2, learning_rate=0.25, registered_model_name=registered_model_name, ), code="./src/", # location of source code command="python main.py --data ${{inputs.data}} --test_train_ratio ${{inputs.test_train_ratio}} --learning_rate ${{inputs.learning_rate}} --registered_model_name ${{inputs.registered_model_name}}", environment="AzureML-sklearn-1.0-ubuntu20.04-py38-cpu@latest", compute="cpu-cluster", #delete this line to use serverless compute display_name="credit_default_prediction",�hhuh��(hh�h}�ub�$c87b9a69-864e-470d-b795-8cda3e9b1a74�h )��}�(h }�(hX�) Submit the job It's now time to submit the job to run in Azure Machine Learning. This time you'll use create_or_update on ml_client . ml_client.create_or_update(job) View job output and wait for job completion View the job in Azure Machine Learning studio by selecting the link in the output of the previous cell. The output of this job will look like this in the Azure Machine Learning studio. Explore the tabs for various details like metrics, outputs etc. Once completed, the job will register a model in your workspace as a result of training. Important Wait until the status of the job is complete before returning to this notebook to continue. The job will take 2 to 3 minutes to run. It could take longer (up to 10 minutes) if the compute cluster has been scaled down to zero nodes and custom environment is still building. Deploy the model as an online endpoint Now deploy your machine learning model as a web service in the Azure cloud, an online endpoint . To deploy a machine learning service, you'll use the�hhuh��(hh�h}�ub�$cac1f436-5f87-4690-9b00-8d4200c7e24f�h )��}�(h }�(hX model you registered. Create a new online endpoint Now that you have a registered model, it's time to create your online endpoint. The endpoint name needs to be unique in the entire Azure region. For this tutorial, you'll create a unique name using UUID . import uuid�hhuh��(hh�h}�ub�$aa963511-43d8-4c81-99c1-287c214afa4a�h )��}�(h }�(hX�# Creating a unique name for the endpoint online_endpoint_name = "credit-endpoint-" + str(uuid.uuid4())[:8] Create the endpoint: # Expect the endpoint creation to take a few minutes from azure.ai.ml.entities import ( ManagedOnlineEndpoint, ManagedOnlineDeployment, Model, Environment, ) # create an online endpoint endpoint = ManagedOnlineEndpoint( name=online_endpoint_name, description="this is an online endpoint", auth_mode="key", tags={ "training_dataset": "credit_defaults", "model_type": "sklearn.GradientBoostingClassifier", }, ) endpoint = ml_client.online_endpoints.begin_create_or_update(endpoint).result() print(f"Endpoint {endpoint.name} provisioning state: {endpoint.provisioning_state}") Note Expect the endpoint creation to take a few minutes. Once the endpoint has been created, you can retrieve it as below: endpoint = ml_client.online_endpoints.get(name=online_endpoint_name)�hhuh��(hh�h}�ub�$47395e31-f563-4d05-aa60-d4ae9319a943�h )��}�(h }�(hXrprint( f'Endpoint "{endpoint.name}" with provisioning state "{endpoint.provisioning_state}" is retrieved' ) Deploy the model to the endpoint Once the endpoint is created, deploy the model with the entry script. Each endpoint can have multiple deployments. Direct traffic to these deployments can be specified using rules. Here you'll create a single deployment that handles 100% of the incoming traffic. We have chosen a color name for the deployment, for example, blue , green , red deployments, which is arbitrary. You can check the Models page on Azure Machine Learning studio, to identify the latest version of your registered model. Alternatively, the code below will retrieve the latest version number for you to use. # Let's pick the latest version of the model latest_model_version = max( [int(m.version) for m in ml_client.models.list(name=registered_model_name)] )�hhuh��(hh�h}�ub�$a265d0ab-3778-409a-91c2-87eaf2014c8b�h )��}�(h }�(hXprint(f'Latest model is version "{latest_model_version}" ') Deploy the latest version of the model. # picking the model to deploy. Here we use the latest version of our registered model model = ml_client.models.get(name=registered_model_name, version=latest_model_version)�hhuh��(hh�h}�ub�$db5c1ed0-c0b7-447c-ad3a-e9fdf830bfda�h )��}�(h }�(hX�# Expect this deployment to take approximately 6 to 8 minutes. # create an online deployment. # if you run into an out of quota error, change the instance_type to a comparable VM that is available.\ # Learn more on https://azure.microsoft.com/en-us/pricing/details/machine-learning/. blue_deployment = ManagedOnlineDeployment( name="blue", endpoint_name=online_endpoint_name, model=model, instance_type="Standard_DS3_v2", instance_count=1, )�hhuh��(hh�h}�ub�$5f2f3dfd-df76-4f7a-bf29-5c3e729c0eae�h )��}�(h }�(hX�blue_deployment = ml_client.begin_create_or_update(blue_deployment).result() Note Expect this deployment to take approximately 6 to 8 minutes. When the deployment is done, you're ready to test it. Test with a sample query Once the model is deployed to the endpoint, you can run inference with it. Create a sample request file following the design expected in the run method in the score script. deploy_dir = "./deploy" os.makedirs(deploy_dir, exist_ok=True) %%writefile {deploy_dir}/sample-request.json { "input_data": { "columns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22], "index": [0, 1], "data": [ [20000,2,2,1,24,2,2,-1,-1,-2,-2,3913,3102,689,0,0,0,0,689,0,0,0,0], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 10, 9, 8] ] } } # test the blue deployment with some sample data ml_client.online_endpoints.invoke( endpoint_name=online_endpoint_name, request_file="./deploy/sample-request.json", deployment_name="blue",�hhuh��(hh�h}�ub�$1cb01f57-7732-4c23-a3b7-7bdbef1a0342�h )��}�(h }�(hX�) Clean up resources If you're not going to use the endpoint, delete it to stop using the resource. Make sure no other deployments are using an endpoint before you delete it. Note Expect the complete deletion to take approximately 20 minutes. ml_client.online_endpoints.begin_delete(name=online_endpoint_name) Stop compute instance If you're not going to use it now, stop the compute instance: In the studio, in the left navigation area, select Compute . In the top tabs, select Compute instances Select the compute instance in the list. On the top toolbar, select Stop . Delete all resources Important The resources that you created can be used as prerequisites to other Azure Machine Learning tutorials and how-to articles. If you don't plan to use any of the resources that you created, delete them so you don't incur any charges: In the Azure portal, select Resource groups on the far left. From the list, select the resource group that you created. Select Delete resource group . Enter the resource group name. Then�hhuh��(hh�h}�ub�$fc236cff-9ed0-4311-8b44-0f60e33117b7�h )��}�(h }�(hXselect Delete . Next steps Now that you have an idea of what's involved in training and deploying a model, learn more about the process in these tutorials: Tutorial Description Upload, access and explore your data in Azure Machine Learning Store large data in the cloud and retrieve it from notebooks and scripts Model development on a cloud workstation Start prototyping and developing machine learning models Train a model in Azure Machine Learning Dive in to the details of training a model Deploy a model as an online endpoint Dive in to the details of deploying a model Create production machine learning pipelines Split a complete machine learning task into a multistep workflow. Feedback Submit and view feedback for This product This page View all page feedback Additional resources Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of Use Trademarks © Microsoft 2023 Additional resources In this article Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of�hhuh��(hh�h}�ub�$42c22493-4690-4bf5-82b6-aeedfd5cac89�h )��}�(h }�(h� Use Trademarks © Microsoft 2023�hhuh��(hh�h}�ub�$47c3f5fe-2b1b-4d89-894c-b0644fcd68e1�h )��}�(h }�(hX�CLI & SDK v2 - Azure Machine Learning | Microsoft Learn Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Download Microsoft Edge More info about Internet Explorer and Microsoft Edge Table of contents Exit focus mode Read in English Save Table of contents Read in English Save Edit Print Twitter LinkedIn Facebook Email Table of contents What is Azure Machine Learning CLI & Python SDK v2? Article 02/24/2023 6 contributors Feedback In this article APPLIES TO: Azure CLI ml extension v2 (current) Python SDK azure-ai-ml v2 (current) Azure Machine Learning CLI v2 and Azure Machine Learning Python SDK v2 introduce a consistency of features and terminology across the interfaces. In order to create this consistency, the syntax of commands differs, in some cases significantly, from the first versions (v1). Azure Machine Learning CLI v2 The Azure Machine Learning CLI v2 (CLI v2) is the latest extension�h}�(h� concept-v2�h�Chttps://learn.microsoft.com/en-us/azure/machine-learning/concept-v2�uuh��(hh�h}�ub�$e8fa993a-7cb0-44a7-9da3-86247f117eb3�h )��}�(h }�(hXfor the Azure CLI . The CLI v2 provides commands in the format az ml <noun> <verb> <options> to create and maintain Azure Machine Learning assets and workflows. The assets or workflows themselves are defined using a YAML file. The YAML file defines the configuration of the asset or workflow – what is it, where should it run, and so on. A few examples of CLI v2 commands: az ml job create --file my_job_definition.yaml az ml environment update --name my-env --file my_updated_env_definition.yaml az ml model list az ml compute show --name my_compute Use cases for CLI v2 The CLI v2 is useful in the following scenarios: On board to Azure Machine Learning without the need to learn a specific programming language The YAML file defines the configuration of the asset or workflow – what is it, where should it run, and so on. Any custom logic/IP used, say data preparation, model training, model scoring can remain in script files, which are referred to in the YAML, but not part of the YAML itself. Azure Machine Learning�hh�uh��(hh�h}�ub�$934b7371-180d-400e-aed8-5f229c178adb�h )��}�(h }�(hX�supports script files in python, R, Java, Julia or C#. All you need to learn is YAML format and command lines to use Azure Machine Learning. You can stick with script files of your choice. Ease of deployment and automation The use of command-line for execution makes deployment and automation simpler, since workflows can be invoked from any offering/platform, which allows users to call the command line. Managed inference deployments Azure Machine Learning offers endpoints to streamline model deployments for both real-time and batch inference deployments. This functionality is available only via CLI v2 and SDK v2. Reusable components in pipelines Azure Machine Learning introduces components for managing and reusing common logic across pipelines. This functionality is available only via CLI v2 and SDK v2. Azure Machine Learning Python SDK v2 Azure Machine Learning Python SDK v2 is an updated Python SDK package, which allows users to: Submit training jobs Manage data, models, environments Perform managed�hh�uh��(hh�h}�ub�$8bbcbf0c-233e-41fb-969a-6e60049faf28�h )��}�(h }�(hX�inferencing (real time and batch) Stitch together multiple tasks and production workflows using Azure Machine Learning pipelines The SDK v2 is on par with CLI v2 functionality and is consistent in how assets (nouns) and actions (verbs) are used between SDK and CLI. For example, to list an asset, the list action can be used in both CLI and SDK. The same list action can be used to list a compute, model, environment, and so on. Use cases for SDK v2 The SDK v2 is useful in the following scenarios: Use Python functions to build a single step or a complex workflow SDK v2 allows you to build a single command or a chain of commands like Python functions - the command has a name, parameters, expects input, and returns output. Move from simple to complex concepts incrementally SDK v2 allows you to: Construct a single command. Add a hyperparameter sweep on top of that command, Add the command with various others into a pipeline one after the other. This construction is useful, given the iterative nature of machine�hh�uh��(hh�h}�ub�$d2f4cbcb-5257-4519-a8da-b3de7ad62915�h )��}�(h }�(hX�learning. Reusable components in pipelines Azure Machine Learning introduces components for managing and reusing common logic across pipelines. This functionality is available only via CLI v2 and SDK v2. Managed inferencing Azure Machine Learning offers endpoints to streamline model deployments for both real-time and batch inference deployments. This functionality is available only via CLI v2 and SDK v2. Should I use v1 or v2? CLI v2 The Azure Machine Learning CLI v1 has been deprecated. We recommend you to use CLI v2 if: You were a CLI v1 user You want to use new features like - reusable components, managed inferencing You don't want to use a Python SDK - CLI v2 allows you to use YAML with scripts in python, R, Java, Julia or C# You were a user of R SDK previously - Azure Machine Learning won't support an SDK in R . However, the CLI v2 has support for R scripts. You want to use command line based automation/deployments You don't need Spark Jobs. This feature is currently available in preview in CLI v2. SDK�hh�uh��(hh�h}�ub�$53e7bc03-f17f-4c80-805a-396e1cb5a30a�h )��}�(h }�(hX�v2 The Azure Machine Learning Python SDK v1 doesn't have a planned deprecation date. If you have significant investments in Python SDK v1 and don't need any new features offered by SDK v2, you can continue to use SDK v1. However, you should consider using SDK v2 if: You want to use new features like - reusable components, managed inferencing You're starting a new workflow or pipeline - all new features and future investments will be introduced in v2 You want to take advantage of the improved usability of the Python SDK v2 - ability to compose jobs and pipelines using Python functions, easy evolution from simple to complex tasks etc. Next steps How to upgrade from v1 to v2 Get started with CLI v2 Install and set up CLI (v2) Train models with the CLI (v2) Deploy and score models with online endpoints Get started with SDK v2 Install and set up SDK (v2) Train models with the Azure Machine Learning Python SDK v2 Tutorial: Create production ML pipelines with Python SDK v2 in a Jupyter notebook Feedback Submit and�hh�uh��(hh�h}�ub�$917b8f5b-f818-4d36-a6a1-ca436ceb4434�h )��}�(h }�(hX_view feedback for This product This page View all page feedback Additional resources Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of Use Trademarks © Microsoft 2023 Additional resources In this article Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of Use Trademarks © Microsoft 2023�hh�uh��(hh�h}�ub�$30bbc54a-a687-465b-8c45-f1c0ac9180bf�h )��}�(h }�(hX�What is Azure Machine Learning? - Azure Machine Learning | Microsoft Learn Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. Download Microsoft Edge More info about Internet Explorer and Microsoft Edge Table of contents Exit focus mode Read in English Save Table of contents Read in English Save Edit Print Twitter LinkedIn Facebook Email Table of contents What is Azure Machine Learning? Article 03/01/2023 13 contributors Feedback In this article Azure Machine Learning is a cloud service for accelerating and managing the machine learning project lifecycle. Machine learning professionals, data scientists, and engineers can use it in their day-to-day workflows: Train and deploy models, and manage MLOps. You can create a model in Azure Machine Learning or use a model built from an open-source platform, such as Pytorch, TensorFlow, or scikit-learn. MLOps tools help you monitor, retrain, and redeploy�h}�(h�'overview-what-is-azure-machine-learning�h�`https://learn.microsoft.com/en-us/azure/machine-learning/overview-what-is-azure-machine-learning�uuh��(hh�h}�ub�$eba93cb3-f47a-4b8a-91c8-bf90fd328361�h )��}�(h }�(hX�models. Tip Free trial! If you don't have an Azure subscription, create a free account before you begin. Try the free or paid version of Azure Machine Learning . You get credits to spend on Azure services. After they're used up, you can keep the account and use free Azure services . Your credit card is never charged unless you explicitly change your settings and ask to be charged. Who is Azure Machine Learning for? Azure Machine Learning is for individuals and teams implementing MLOps within their organization to bring machine learning models into production in a secure and auditable production environment. Data scientists and ML engineers will find tools to accelerate and automate their day-to-day workflows. Application developers will find tools for integrating models into applications or services. Platform developers will find a robust set of tools, backed by durable Azure Resource Manager APIs, for building advanced ML tooling. Enterprises working in the Microsoft Azure cloud will find familiar security�hj&uh��(hh�h}�ub�$394d791b-2cc6-4054-a499-89b37f34a995�h )��}�(h }�(hX�and role-based access control (RBAC) for infrastructure. You can set up a project to deny access to protected data and select operations. Productivity for everyone on the team Machine learning projects often require a team with varied skill set to build and maintain. Azure Machine Learning has tools that help enable you to: Collaborate with your team via shared notebooks, compute resources, data, and environments Develop models for fairness and explainability, tracking and auditability to fulfill lineage and audit compliance requirements Deploy ML models quickly and easily at scale, and manage and govern them efficiently with MLOps Run machine learning workloads anywhere with built-in governance, security, and compliance Cross-compatible platform tools that meet your needs Anyone on an ML team can use their preferred tools to get the job done. Whether you're running rapid experiments, hyperparameter-tuning, building pipelines, or managing inferences, you can use familiar interfaces including: Azure Machine�hj&uh��(hh�h}�ub�$12235746-e1dc-4415-8952-466495eb404c�h )��}�(h }�(hX�Learning studio Python SDK (v2) CLI (v2) ) Azure Resource Manager REST APIs As you're refining the model and collaborating with others throughout the rest of Machine Learning development cycle, you can share and find assets, resources, and metrics for your projects on the Azure Machine Learning studio UI. Studio The Azure Machine Learning studio offers multiple authoring experiences depending on the type of project and the level of your past ML experience, without having to install anything. Notebooks: write and run your own code in managed Jupyter Notebook servers that are directly integrated in the studio. Visualize run metrics: analyze and optimize your experiments with visualization. Azure Machine Learning designer: use the designer to train and deploy machine learning models without writing any code. Drag and drop datasets and components to create ML pipelines. Automated machine learning UI: Learn how to create automated ML experiments with an easy-to-use interface. Data labeling: Use Azure Machine�hj&uh��(hh�h}�ub�$823e642c-47d6-4eb6-bb95-73091196b186�h )��}�(h }�(hX�Learning data labeling to efficiently coordinate image labeling or text labeling projects. Enterprise-readiness and security Azure Machine Learning integrates with the Azure cloud platform to add security to ML projects. Security integrations include: Azure Virtual Networks (VNets) with network security groups Azure Key Vault where you can save security secrets, such as access information for storage accounts Azure Container Registry set up behind a VNet See Tutorial: Set up a secure workspace . Azure integrations for complete solutions Other integrations with Azure services support a machine learning project from end-to-end. They include: Azure Synapse Analytics to process and stream data with Spark Azure Arc, where you can run Azure services in a Kubernetes environment Storage and database options, such as Azure SQL Database, Azure Storage Blobs, and so on Azure App Service allowing you to deploy and manage ML-powered apps Microsoft Purview allows you to discover and catalog data assets across your�hj&uh��(hh�h}�ub�$ddfa562d-7829-4dfa-86ef-3c6a2c11aac8�h )��}�(h }�(hX�organization Important Azure Machine Learning doesn't store or process your data outside of the region where you deploy. Machine learning project workflow Typically models are developed as part of a project with an objective and goals. Projects often involve more than one person. When experimenting with data, algorithms, and models, development is iterative. Project lifecycle While the project lifecycle can vary by project, it will often look like this: A workspace organizes a project and allows for collaboration for many users all working toward a common objective. Users in a workspace can easily share the results of their runs from experimentation in the studio user interface or use versioned assets for jobs like environments and storage references. For more information, see Manage Azure Machine Learning workspaces . When a project is ready for operationalization, users' work can be automated in a machine learning pipeline and triggered on a schedule or HTTPS request. Models can be deployed to the managed�hj&uh��(hh�h}�ub�$e429a525-618d-4402-8a09-daab271c68cf�h )��}�(h }�(hX�inferencing solution, for both real-time and batch deployments, abstracting away the infrastructure management typically required for deploying models. Train models In Azure Machine Learning, you can run your training script in the cloud or build a model from scratch. Customers often bring models they've built and trained in open-source frameworks, so they can operationalize them in the cloud. Open and interoperable Data scientists can use models in Azure Machine Learning that they've created in common Python frameworks, such as: PyTorch TensorFlow scikit-learn XGBoost LightGBM Other languages and frameworks are supported as well, including: R .NET See Open-source integration with Azure Machine Learning . Automated featurization and algorithm selection (AutoML) In a repetitive, time-consuming process, in classical machine learning data scientists use prior experience and intuition to select the right data featurization and algorithm for training. Automated ML (AutoML) speeds this process and can be used�hj&uh��(hh�h}�ub�$5e302a09-a3e1-44fb-a46b-d568c3f03a6c�h )��}�(h }�(hX�through the studio UI or Python SDK. See What is automated machine learning? Hyperparameter optimization Hyperparameter optimization, or hyperparameter tuning, can be a tedious task. Azure Machine Learning can automate this task for arbitrary parameterized commands with little modification to your job definition. Results are visualized in the studio. See How to tune hyperparameters . Multinode distributed training Efficiency of training for deep learning and sometimes classical machine learning training jobs can be drastically improved via multinode distributed training. Azure Machine Learning compute clusters offer the latest GPU options. Supported via Azure Machine Learning Kubernetes and Azure Machine Learning compute clusters: PyTorch TensorFlow MPI The MPI distribution can be used for Horovod or custom multinode logic. Additionally, Apache Spark is supported via Azure Synapse Analytics Spark clusters (preview). Important Using Apache Spark via Azure Synapse Analytics Spark clusters is in public preview.�hj&uh��(hh�h}�ub�$a6ffcda1-dce3-4312-9ed0-683fa80e8138�h )��}�(h }�(h��The preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.�hj&uh��(hh�h}�ub�$5f1e2637-6e9a-4fea-ae0e-755c4631ab34�h )��}�(h }�(hX�For more information, see Supplemental Terms of Use for Microsoft Azure Previews . See Distributed training with Azure Machine Learning . Embarrassingly parallel training Scaling a machine learning project may require scaling embarrassingly parallel model training. This pattern is common for scenarios like forecasting demand, where a model may be trained for many stores. Deploy models To bring a model into production, it's deployed. Azure Machine Learning's managed endpoints abstract the required infrastructure for both batch or real-time (online) model scoring (inferencing). Real-time and batch scoring (inferencing) Batch scoring , or batch inferencing , involves invoking an endpoint with a reference to data. The batch endpoint runs jobs asynchronously to process data in parallel on compute clusters and store the data for further analysis. Real-time scoring , or online inferencing , involves invoking an endpoint with one or more model deployments and receiving a response in near-real-time via HTTPs. Traffic�hj&uh��(hh�h}�ub�$ff4f631b-dd8e-4f3c-8246-5a33ba1c3472�h )��}�(h }�(hX�can be split across multiple deployments, allowing for testing new model versions by diverting some amount of traffic initially and increasing once confidence in the new model is established. See: Deploy a model with a real-time managed endpoint Use batch endpoints for scoring MLOps: DevOps for machine learning DevOps for machine learning models, often called MLOps, is a process for developing models for production. A model's lifecycle from training to deployment must be auditable if not reproducible. ML model lifecycle Learn more about MLOps in Azure Machine Learning . Integrations enabling MLOPs Azure Machine Learning is built with the model lifecycle in mind. You can audit the model lifecycle down to a specific commit and environment. Some key features enabling MLOps include: git integration MLflow integration Machine learning pipeline scheduling Azure Event Grid integration for custom triggers Easy to use with CI/CD tools like GitHub Actions or Azure DevOps Also, Azure Machine Learning includes features�hj&uh��(hh�h}�ub�$dbd2d349-edad-4a25-9937-fb4c3de09089�h )��}�(h }�(hX�for monitoring and auditing: Job artifacts, such as code snapshots, logs, and other outputs Lineage between jobs and assets, such as containers, data, and compute resources Next steps Start using Azure Machine Learning: Set up an Azure Machine Learning workspace Tutorial: Build a first machine learning project How to run training jobs Feedback Submit and view feedback for This product This page View all page feedback Additional resources Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of Use Trademarks © Microsoft 2023 Additional resources In this article Theme Light Dark High contrast Previous Versions Blog Contribute Privacy Terms of Use Trademarks © Microsoft 2023�hj&uh��(hh�h}�ubusb}�(KhKhKh"Kh)Kh0Kh7Kh>KhEKhLK hSK hZK haK hhK hoKhvKh}Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�Kh�K h�K!h�K"jK#j K$jK%jK&j!K'j+K(j2K)j9K*j@K+jGK,jNK-jUK.j\K/jcK0jjK1jqu��.