สร้าง Data Context

การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Davina Moossazadeh

Data Scientist

คุณภาพข้อมูลคืออะไร?

ความเหมาะสมของชุดข้อมูลกับวัตถุประสงค์ที่ต้องการ

  • ความครบถ้วน
  • ความถูกต้อง
  • ความสมเหตุสมผล
  • ความไม่ซ้ำซ้อน
  • ความทันสมัย
  • ความสมบูรณ์
  • ความสอดคล้อง
  • และอื่นๆ

กราฟกระจายแสดงกลุ่มค่าและค่าผิดปกติ

1 https://nitin9809.medium.com/outlier-detection-and-treatment-part-1-aa0b09f60e50
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

ทำไมคุณภาพข้อมูลจึงสำคัญ?

ขยะเข้า

โมเดลที่ดีเยี่ยมรับขยะเป็น input

ขยะออก

โมเดลจะดีได้เพียงเท่าที่ข้อมูลที่ป้อนเข้าไปดีเท่านั้น!

การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Great Expectations คืออะไร?

โลโก้ Great Expectations

Great Expectations (GX) - แพลตฟอร์มสำหรับจัดการคุณภาพข้อมูล

  • GX Cloud - UI บนเว็บ
  • GX Core - Python package
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Expectations

Expectation - ข้อกำหนดที่ตรวจสอบได้เกี่ยวกับข้อมูล

  • รูปร่างของชุดข้อมูล
  • ค่า Null
  • ข้อมูลซ้ำ
  • ชุดค่า/ช่วงค่า
  • รูปแบบ String
  • การกระจายของข้อมูล
  • ปัญหาคุณภาพข้อมูล
  • และอื่นๆ

images-1.png

1 https://docs.greatexpectations.io/docs/core/define_expectations/create_an_expectation/ https://mathbitsnotebook.com/Algebra2/Statistics/STnormalDistribution.html
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Data Contexts

Data Context - จุดเริ่มต้นหลักของการใช้งาน GX

  • การตั้งค่าและเมธอดสำหรับคอมโพเนนต์ GX ทั้งหมด
    • Data Sources
    • Expectation Suites
    • Checkpoints
    • Data Docs
    • Validation Results
    • Metrics
1 https://docs.greatexpectations.io/docs/core/set_up_a_gx_environment/create_a_data_context/
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

การนำเข้า GX

นำเข้า Great Expectations โดยใช้ alias gx:

import great_expectations as gx
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

การสร้าง Data Context

ใช้ get_context() เพื่อสร้าง Data Context:

context = gx.get_context()

print(context)
{ "analytics_enabled": true,
  "checkpoint_store_name": "default_checkpoint_store",
  "config_variables_file_path": "uncommitted/config_variables.yml",
  "config_version": 4.0,
  "data_context_id": "5b407294-b17c-43e3-aa5f-4f8a4741e772",
  "expectations_store_name": "default_expectations_store",
  "fluent_datasources": {},
  "plugins_directory": "plugins/",
  "stores": {},
  "validation_results_store_name": "default_validations_store" }
การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

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

การตรวจสอบคุณภาพข้อมูลด้วย Great Expectations เบื้องต้น

Preparing Video For Download...