Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

JINIers

Deploy a BigQuery ML Customer Churn Classifier to Vertex AI for Online Predictions 본문

GCP/Qwiklabs

Deploy a BigQuery ML Customer Churn Classifier to Vertex AI for Online Predictions

JINIers 2022. 4. 26. 10:23

온라인 예측을 위해 big query ML 고객 이탈 분류기를 vertex ai에 배포


개요

bigquery ML XGBoost 모델을 사용하여 일괄 및 온라인 예측을 학습, 조정, 평가, 설명,생성함
사용자가 애플리케이션으로 돌아올 가능성 확인
bigquery ML 모델로 일괄예측 생성, vertex pyhton SDK를 사용하여 온라인 예측을 위해 vertex AI로 내보내고 배포

 


목표

  1. 기계학습용 bigquery에서 google 애널리틱스 4 데이터 샘플을 탐색하고 사전처리함
  2. bigquery ML XGBoost 분류기를 학습시켜 모바일 게임 애플리케이션에서 사용자 이탈 예측
  3. bigquery ML 초 매개변수 조정기능을 사용하여  bigquery ML XGBoost 분류기 조정
  4. bigquery ML XGBoost 분류기의 성능 평가
  5. bigquery ML explainable ai 전역 기능 속성으로 XGBoost 모델 설명
  6. bigquery ML XGBoost 모델로 일괄 예측 생성
  7. bigquery ML XGBoost 모델을 google cloud storage 버킷으로 내보냄
  8. bigquery ML XGBoost 모델을 온라인 예측을 위해 vertex ai 예측 엔드포인트에 업로드 후 배포

 

 


1. google cloud 서비스 활성화

gcloud services enable \
  compute.googleapis.com \
  iam.googleapis.com \
  iamcredentials.googleapis.com \
  monitoring.googleapis.com \
  logging.googleapis.com \
  notebooks.googleapis.com \
  aiplatform.googleapis.com \
  bigquery.googleapis.com

  


2. vertex notebook 인스턴스 배포

vertex ai > workbench > user- maged notebooks > create notebook

name : 아무거나
tensorflow enterprise : tensorflow enterprise2.3
zone : us-central1

create > open jupyterlab 클릭


3. 랩 리포지토리 복제

open jupyterlab > terminal 클릭

cd
git clone https://github.com/GoogleCloudPlatform/training-data-analyst


training-data-analyst에 복제 되었는지 확인


[랩 노트북으로 이동]

training-data-analyst > quests > vertex-ai > vertex-bqml 로 이동하고 lab_exercise.ipynb 오픈
shift+enter로 쭉쭉 내리면 작업 끝!


4. bigquery 데이터세트 만들기
shift+enter로 쭉쭉 내리면 작업 4 끝

데이터 세트 생성 완료!
id : bqmlga4


5. bigquery ML XGBoost 이탈성향 모델만들기
좀 한참걸림...
값이 나올 때 까지 건드리지말고 조용히 놔둘것...


6. bigquery ML 모델 평가
얘도...shift+enter 하다보면 체크 됨..

 

7. bigquery ML 모델로 일괄 예측 사용자 이탈
얘도.. shift+enter..

얘는 terminal에서 파일 복사 받은 후에 랩 노트북으로 이동해서 shift+enter만 하면 체크가 되는 것 같은데 5,6 여기서 좀 오래걸림..

 

작업 4 ~ 7은 랩 노트북에서 하는건데 솔직히 잘 모르겠다. shift+enter 하면 뭔가 로딩이 되면서 결과값이 뿅뿅뿅 나오는데 잘 모르겟음 이게 되고 있는건가..

근데 작업은 착착착 체크 되서 뭐가 뭘 의미하는건지도 모르겠고 그냥 모르겠어요..

 

Comments