예측 변수 추가

Python 중급 예측 분석

Nele Verbiest

Senior Data Scientist @PythonPredictions

예측 변수

  • 인구 통계:
    • 나이
    • 성별
    • 거주지
  • 소비 행동
  • 시청 행동
  • 제품 사용
  • 인터넷 이용 행동
  • 결제 정보
Python 중급 예측 분석

타임라인 준수 예측 변수 (1)

Python 중급 예측 분석

타임라인 준수 예측 변수 (2)

Python 중급 예측 분석

생애 기간 추가

# Reference date
reference_date = datetime.date(2018,4,1)

# Add lifetime to the basetable basetable["lifetime"] = reference_date - basetable["member_since"] print(basetable.head())
donor_id member_since lifetime
1        2015-02-03   1153
2        2016-01-30   729
3        2016-02-23   768
Python 중급 예측 분석

선호 연락 채널 추가 (1)

donor_id start_valid_date end_valid_date  contact_channel
1        2014-02-03       2016-03-04      "phone"
1        2016-03-04       2016-05-08      "e-mail"
2        2016-02-23       2026-02-23      "e-mail"
reference_date = datetime.date(2018,4,1)

# Select lines compliant with reference data contact_channel_reference_date = living_places[ (contact_channel["start_valid_date"]<=reference_date) & (living_places["end_valid_date"]>reference_date)]
Python 중급 예측 분석

선호 연락 채널 추가 (2)

# Add contact channel place to the basetable
basetable = 
    pd.merge(
     basetable, 
     living_places_reference_date[["donor_ID","contact_channel"]],
     on="donor_ID"
    )
print(basetable.head())
donor_id contact_channel
1        "phone"
2        "phone"
3        "e-mail"
Python 중급 예측 분석

연습해 봅시다!

Python 중급 예측 분석

Preparing Video For Download...