基表時間軸

Python 中級預測分析

Nele Verbiest Ph. D.

Senior Data Scientist @PythonPredictions

預測建模流程

預測分析基礎 I:

  • 建立預測模型
  • 評估預測模型
  • 向商業利害關係人呈現模型

預測分析基礎 II:

  • 建構基表(basetable)
Python 中級預測分析

基表(1)

Python 中級預測分析

基表(2)

Python 中級預測分析

基表(3)

Python 中級預測分析

基表(4)

Python 中級預測分析

時間軸(1)

Python 中級預測分析

時間軸(2)

Python 中級預測分析

時間軸(3)

Python 中級預測分析

時間軸(4)

Python 中級預測分析

重建歷史(1)

Python 中級預測分析

重建歷史(2)

Python 中級預測分析

重建歷史(3)

Python 中級預測分析

在 Python 中篩選相關資料

import pandas as pd
gifts = pd.read_csv("gifts.csv")
gifts["date"] = pd.to_datetime(gifts["date"])
print(gifts.head())
   id       date  amount
0   1 2015-10-16    75.0
1   1 2014-02-11   111.0
2   1 2012-03-28    93.0
3   1 2013-12-13   113.0
4   1 2012-01-10    93.0
start_target = datetime(year = 2018, month = 5, day = 1)
end_target = datetime(year = 2018, month = 8, day = 1)

gifts_target = gifts[(gifts["date"]>=start_target) & (gifts["date"]<end_target)]
gifts_pred_variables = gifts[(gifts["date"]<start_target]
Python 中級預測分析

一起來練習吧!

Python 中級預測分析

Preparing Video For Download...