Azure machine learning에서 model을 학습해봅시다.

TODO : Azure Machine Learning의 command job을 이용하여 associated credit card dataset으로 credit card payment를 불이행할 높은 확률을 가지는 고객들을 예측하는 모델을 학습하기

azure에서 제공해주는 associated credit card dataset을 이용해 이번 실습을 수행해 보겠습니다. [dataset Link]

Step 1. Azure Machine Learning Workspace 다루기

Workspaces는 동료들과 머신러닝 아티팩트들을 생성하고 관련된 작업들을 그룹화하는 협업을 수행하는 장소입니다. 이 장소에는 experiments, jobs, datasets, models, components, inference endpoints 등이 있습니다. 여기서 작업을 하기 위해서는 먼저 생성을 해줘야겠죠?

workspace 생성

코드에서 workspace를 다루기

workspace는 azure.ai.mlMLClient 객체를 이용해 다룰 수 있습니다. 이 객체는 resources와 jobs를 관리합니다.

그러려면 먼저 이 패키지를 설치해줘야겠죠?

참고 : https://learn.microsoft.com/ko-kr/python/api/overview/azure/ai-ml-readme?view=azure-python

$ pip install azure-ai-ml
$ pip install azure-identity
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

# authenticate
credential = DefaultAzureCredential()

# Azure 리소스 그룹 생성
# Azure Machine Learning Service 워크스페이스 생성
# Get a handle to the workspace
ml_client = MLClient(
    credential=credenial,
    subscription_id="b9#8##4-2###-4a##-####-7##e6##5a###",  # subscription_id - 구독id는 Azure Portal -> Subscription 항목에서 확인 가능
    resource_group_name="resource group name",
    workspace_name="workspace name",
)

Step 2. job 실행을 위한 compute cluster 생성