This project forecasts monthly sales of a fictional company from 10 years of data. Last month, two months ago and the same month last year are built as attributes (windowing) for a linear regression, and accuracy is tested on the most recent months held out separately.
Business Goal
Forecast next-month sales from earlier months and last year's season. Application area: Operations / Inventory Planning. Project level: intermediate.
RapidMiner Tools and Operators
The process is built with these operators:
- Read CSV
- Multiply
- Subprocess
- Generate Attributes
- Select Attributes
- Rename
- Join
- Set Role
- Split Data
- Linear Regression
- Apply Model
- Performance (Regression)
- Performance to Data
- Write CSV
What You Will Learn
- Learn to turn a time series into lag attributes (windowing) using built-in operators
- Judge forecasts with an ordered split and relative error (MAPE)
- Compare the model against simple guesses (last month or last year)
Working Steps
- Read the sales time series — Read CSV loads penjualan_bulanan.csv: 120 months (January 2016 to December 2025) with the columns periode, bulan_ke, promo and penjualan_juta.
- Duplicate the data to build lags — Multiply makes four copies: one as the main table and three for shifting time by 1, 2 and 12 months.
- Build the lag attributes in each Subprocess — Inside Subprocess Lag k: Generate Attributes creates the key k = bulan_ke + k, Select Attributes keeps the key and sales, and Rename turns sales into lag_k.
- Combine the lags with Join — Three Join operators (inner) match bulan_ke with each lag key so every row now holds sales 1, 2 and 12 months earlier. Rows of the first year that lack lag_12 are not used.
- Set the label and id — Select Attributes removes the key columns, then Set Role makes penjualan_juta the label and periode the id.
- Split the data in time order — Split Data with linear sampling 80:20 keeps time order: the model trains on early months and is tested on the latest months, just like a real forecasting situation.



