在 Databricks 中进行机器学习

Databricks 概念

Kevin Barlow

Data Practitioner

机器学习生命周期

机器学习生命周期

1 https://www.datacamp.com/blog/machine-learning-lifecycle-explained
Databricks 概念

规划与准备

ML 生命周期 - EDA

Databricks 概念

机器学习规划

我有什么?

  1. 数据可用性
  2. 业务需求
  3. 数据科学家/数据分析师

数据团队与资源

我想要什么?

  1. 用例
  2. 合规与安全
  3. 业务结果

业务结果

Databricks 概念

ML Runtime

  • Databricks 计算的扩展
  • 为机器学习优化
  • 内置常用库与框架
    • scikit-learnSparkMLTensorFlow
    • MLFlow
  • 支持集群库管理

Databricks ML Runtime

Databricks 概念

探索性数据分析

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

在 Databricks 中进行探索性数据分析

Databricks 概念

特征表与特征存储

原始数据
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
特征表
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 特征存储

  • 特征化数据集的集中存储
  • 便于发现与复用模型特征
  • 上下游血缘追踪

Databricks 特征存储

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 概念

¡Vamos a practicar!

Databricks 概念

Preparing Video For Download...