การใช้ Databricks สำหรับ machine learning

แนวคิด Databricks

Kevin Barlow

Data Practitioner

วงจรชีวิตของ Machine Learning

วงจรชีวิตของ Machine Learning

1 https://www.datacamp.com/blog/machine-learning-lifecycle-explained
แนวคิด Databricks

การวางแผนและเตรียมความพร้อม

ML Lifecycle - EDA

แนวคิด Databricks

การวางแผนสำหรับ machine learning

มีอะไรอยู่บ้าง?

  1. ความพร้อมของข้อมูล
  2. ความต้องการทางธุรกิจ
  3. นักวิทยาศาสตร์ข้อมูล/นักวิเคราะห์ข้อมูล

ทีมข้อมูลและทรัพยากร

ต้องการอะไร?

  1. Use cases
  2. การปฏิบัติตามกฎหมายและความปลอดภัย
  3. ผลลัพธ์ทางธุรกิจ

ผลลัพธ์ทางธุรกิจ

แนวคิด Databricks

ML Runtime

  • ต่อยอดจาก Databricks compute
  • ปรับแต่งมาเพื่อแอปพลิเคชัน machine learning โดยเฉพาะ
  • มีไลบรารีและเฟรมเวิร์กที่ใช้งานบ่อยครบครัน
    • scikit-learn, SparkML, TensorFlow
    • MLFlow
  • รองรับการจัดการไลบรารีของคลัสเตอร์

Databricks ML Runtime

แนวคิด Databricks

การวิเคราะห์ข้อมูลเชิงสำรวจ

import pandas as pd
pd.describe(df)
# Spark DF
df.summary()
dbutils.data.summarize()
import bamboolib as bam
df

EDA ใน Databricks

แนวคิด Databricks

Feature table และ feature store

ข้อมูลดิบ
count category price shelf_loc rating
4 horror 12.50 end 3
6 romance 13.99 top 4.5
12 sci-fi 16.50 bottom 5
31 romance 9.99 bottom 3.5
23 fantasy 24.99 top 4
18 horror 19.99 end 2.5
19 cooking 17.50 end 4.5
7 fantasy 12.99 top 3
37 sci-fi 14.99 bottom 5
Feature table
count category price shelf_loc rating
4 1 12.50 1 3
6 2 13.99 2 4.5
12 3 16.50 3 5
31 2 9.99 3 3.5
23 4 24.99 2 4
18 1 19.99 1 2.5
19 5 17.50 1 4.5
7 4 12.99 2 3
37 3 14.99 3 5
แนวคิด Databricks

Databricks Feature Store

  • พื้นที่จัดเก็บ feature ของชุดข้อมูลแบบรวมศูนย์
  • ค้นหาและนำ feature กลับมาใช้กับโมเดล machine learning ได้ง่าย
  • ติดตาม lineage ทั้งต้นน้ำและปลายน้ำ

Databricks Feature Store

from databricks import feature_store

fs = feature_store.FeatureStoreClient()

fs.create_table(
    name=table_name,
    primary_keys=["wine_id"],
    df=features_df,
    schema=features_df.schema,
    description="wine features"
)
แนวคิด Databricks

มาฝึกกันเถอะ!

แนวคิด Databricks

Preparing Video For Download...