ตัวแปรเชิงตัวเลข

Feature Engineering สำหรับ Machine Learning ใน Python

Robert O'Callaghan

Director of Data Science, Ordergroove

ประเภทของฟีเจอร์เชิงตัวเลข

  • อายุ
  • ราคา
  • จำนวนนับ
  • ข้อมูลภูมิสารสนเทศ
Feature Engineering สำหรับ Machine Learning ใน Python

ขนาดมีความสำคัญหรือไม่?

Feature Engineering สำหรับ Machine Learning ใน Python

การแปลงตัวแปรเชิงตัวเลขเป็นไบนารี

df['Binary_Violation'] = 0

df.loc[df['Number_of_Violations'] > 0, 'Binary_Violation'] = 1
Feature Engineering สำหรับ Machine Learning ใน Python

การแปลงตัวแปรเชิงตัวเลขเป็นไบนารี

Feature Engineering สำหรับ Machine Learning ใน Python

การจัดกลุ่มตัวแปรเชิงตัวเลข

import numpy as np
df['Binned_Group'] = pd.cut(
    df['Number_of_Violations'], 
    bins=[-np.inf, 0, 2, np.inf],
    labels=[1, 2, 3]
)
Feature Engineering สำหรับ Machine Learning ใน Python

การจัดกลุ่มตัวแปรเชิงตัวเลข

Feature Engineering สำหรับ Machine Learning ใน Python

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

Feature Engineering สำหรับ Machine Learning ใน Python

Preparing Video For Download...