This project predicts weekly sales of 20 stores from advertising spend, price, discounts, competitors and season using linear regression. The model is tested with cross validation and its coefficients are translated into practical effects, such as extra units sold per IDR 1 million of advertising.
Business Goal
Measure how much advertising, price, discounts and season move sales. Application area: Sales. Project level: beginner.
RapidMiner Tools and Operators
The process is built with these operators:
- Read CSV
- Select Attributes
- Nominal to Numerical
- Cross Validation
- Linear Regression
- Apply Model
- Performance (Regression)
- Performance to Data
- Write CSV
What You Will Learn
- Understand linear regression and how to judge it with RMSE and R2
- Turn regression coefficients into numbers usable for ad budgets and pricing
- Practise dummy coding for categorical attributes such as season
Working Steps
- Read the store sales data — Read CSV loads penjualan_toko.csv (1,200 rows: 20 stores x 60 weeks). Set penjualan_unit as a numeric label and id_observasi as the id.
- Drop unused columns — Select Attributes with invert selection removes toko and minggu_ke because they are only identifiers, not explanatory variables.
- Turn season into numbers — Linear regression only accepts numeric attributes. Nominal to Numerical with dummy coding turns season (holiday, dry, rainy) into 0/1 columns.
- Train the regression inside Cross Validation — Cross Validation with 10 folds. The Training part contains Linear Regression (feature selection none, eliminate collinear features on, use bias on).
- Compute prediction errors — Apply Model predicts the test fold; Performance (Regression) computes RMSE, absolute error, relative error and squared correlation (R2).
- Save results and read the coefficients — Performance to Data and Write CSV save the performance measures and each row prediction. The final model goes to a result port; open its Description tab to see the regression equation.



