ADVANCED ML: UNSUPERVISED LEARNING & PRODUCTION / L07TIME SERIES ANALYSIS: ARIMA, PROPHET, ML FORECASTING
课程 · 12 · 07 / 12
LESSON 07 · ADVANCED · 60 MIN · ◆ 1 INSTRUMENT

Time Series Analysis: ARIMA, Prophet, ML Forecasting

Forecast time series data using classical methods (ARIMA) and modern ML approaches (Prophet, LSTMs). Practical forecasting applications.

Introduction: Predicting the Future

Stock prices, weather temperatures, website traffic, energy consumption – all change over time. Time series data has a temporal dimension that traditional ML ignores!

Key Challenge: Past values influence future values. We need models that capture temporal dependencies.

Learning Objectives

  • Understand time series components (trend, seasonality, noise)
  • Master ARIMA models for forecasting
  • Apply exponential smoothing
  • Handle temporal cross-validation
  • Build forecasting pipelines
  • Evaluate forecast accuracy

1. Time Series Components

Decomposition

Any time series can be decomposed into:

  1. Trend: Long-term increase or decrease
  2. Seasonality: Regular patterns (daily, weekly, yearly)
  3. Residual: Random noise
FIG. 02Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 02Interactive Python code execution environment

2. Simple Forecasting Methods

Moving Average

FIG. 04Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 04Interactive Python code execution environment

Exponential Smoothing

FIG. 06Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 06Interactive Python code execution environment

3. ARIMA Models

ARIMA(p, d, q): AutoRegressive Integrated Moving Average

  • p: Order of autoregression (AR)
  • d: Degree of differencing
  • q: Order of moving average (MA)

AR (AutoRegressive)

yt=c+ϕ1yt1+ϕ2yt2+...+ϕpytp+ϵty_t = c + \phi_1 y_{t-1} + \phi_2 y_{t-2} + ... + \phi_p y_{t-p} + \epsilon_t

MA (Moving Average)

yt=μ+ϵt+θ1ϵt1+...+θqϵtqy_t = \mu + \epsilon_t + \theta_1 \epsilon_{t-1} + ... + \theta_q \epsilon_{t-q}
FIG. 08Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 08Interactive Python code execution environment

4. Temporal Cross-Validation

Critical: Never shuffle time series data! Use forward chaining (walk-forward validation).

FIG. 10Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 10Interactive Python code execution environment

5. Forecast Evaluation Metrics

FIG. 12Python Code Executor
INTERACTIVE
LOADING INSTRUMENT
Fig. 12Interactive Python code execution environment

Key Takeaways

Time series has temporal dependencies – order matters!

Components: Trend + Seasonality + Residual

ARIMA models: Flexible framework for time series forecasting

Temporal CV: Use forward chaining, never shuffle

Metrics: MAE, RMSE, MAPE for forecast accuracy


What's Next?

Next lesson: Reinforcement Learning Introduction – agents, rewards, and learning optimal policies!


Further Reading

Interactive Visualizations

Video Tutorials

Papers & Articles

Documentation & Books