Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Visualizing Time Series Components | Foundations of Time Series Analysis
Time Series Forecasting with ARIMA

bookChallenge: Visualizing Time Series Components

Завдання

Swipe to start coding

Your goal is to decompose a time series into its componentstrend, seasonality, and residuals — using the seasonal_decompose() function from statsmodels.

  1. Load the built-in "flights" dataset from seaborn.
  2. Extract the "passengers" column as your target time series.
  3. Apply seasonal_decompose() with an additive model and a period of 12 (months).
  4. Store the result in a variable called decomposition.
  5. Plot the original series, trend, seasonal, and residual components.

seasonal_decompose(series, model="additive", period=12) automatically splits the time series into four parts:

  • trend → long-term movement;
  • seasonal → repeating patterns;
  • resid → random noise;
  • observed → original data.

Each component can be accessed with attributes like .trend, .seasonal, .resid.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

Awesome!

Completion rate improved to 6.67

bookChallenge: Visualizing Time Series Components

Свайпніть щоб показати меню

Завдання

Swipe to start coding

Your goal is to decompose a time series into its componentstrend, seasonality, and residuals — using the seasonal_decompose() function from statsmodels.

  1. Load the built-in "flights" dataset from seaborn.
  2. Extract the "passengers" column as your target time series.
  3. Apply seasonal_decompose() with an additive model and a period of 12 (months).
  4. Store the result in a variable called decomposition.
  5. Plot the original series, trend, seasonal, and residual components.

seasonal_decompose(series, model="additive", period=12) automatically splits the time series into four parts:

  • trend → long-term movement;
  • seasonal → repeating patterns;
  • resid → random noise;
  • observed → original data.

Each component can be accessed with attributes like .trend, .seasonal, .resid.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

some-alt