Bridging the ETL world with analytics and machine learning: preparing data pipelines for analytics needs, integrating R, Python, and Weka for ML models, building predictive data flows, and visualizing model results and outputs in dashboards.

Data isn't only for historical reports — it can answer "what will happen?". Episode 18 covers the bridge between ETL and machine learning. You'll learn to prepare data for analytics, integrate R, Python, and Weka, build predictive flows, and bring the results to dashboards.
The key point: a machine learning model is just a data consumer. Pentaho's job is to prepare the quality data that model eats — work that's often overlooked even though it determines model quality.
Before a model sees data, the pipeline must prepare it. Data quality is 80% of successful machine learning work. The core steps:
Pentaho excels at this part: transformation steps like Group by, Calculator, Join, and Stream lookup are feature engineering tools you've already mastered.
Feature engineering is usually a combination of steps you already know. For example, to build a "total spend in the last 90 days" feature per customer: Sort rows by customer and date, then Group by with a time window already filtered in the source SQL. The goal isn't writing formulas, but assembling a flow that can be explained, tested, and repeated — exactly like regular ETL.
A rule of thumb that applies: the more complex the feature engineering, the more important it is to record the steps. If a feature can't be explained, the model born from it can't be held accountable either.
PDI doesn't replace ML toolkits — it works alongside them. Several integration paths:
The most flexible pattern: PDI prepares the data, then calls an external script, then reads the results back for processing or reporting. An example of a simple Python script that takes data and produces predictions:
import sys
lines = sys.stdin.read().splitlines()
for line in lines:
jumlah = float(line)
risiko = "Tinggi" if jumlah > 1000000 else "Rendah"
print(risiko)Note the pattern above: the script reads from stdin and writes to stdout — a contract easily connected from the Execute Process step in PDI. Before integrating it, test the script standalone from the terminal with python3 script.py — if the output is correct there, integration problems later are almost certainly in the PDI configuration, not the script.
Info
A simple I/O contract — stdin to stdout — is the most portable way to connect PDI with any language. As long as a script accepts lines and returns results, it can be integrated without a special plugin.
A complete predictive flow consists of three phases that can be built as a job:
The training phase usually runs periodically (for example weekly) because the model needs to learn from the latest data; the scoring phase can run far more often. This orchestration fits PDI jobs well: the train_model job collects data and trains the model, then the score_data job uses the model to score incoming data.
The job below shows a simple sequence separating the training and scoring phases:
START -> siapkan_dataset.ktr -> train_model.kjb -> simpan_artefak.kjb
|
-> score_harian.kjb -> tabel_skor.ktrThe train_model job runs weekly and saves the model artifact; the score_harian job runs every night using the latest artifact to score new data. These two paths are deliberately separated so a scoring failure doesn't disrupt the training process — a separation that keeps operations stable.
Danger
Never score with a model whose data leaks from the future. Separate training and testing in time (for example: train with data up to last month, test with this month's data) — the most common and most damaging mistake in predictive flows.
Prediction results are useless if they don't reach decision-makers. Ways to present model output:
A common pattern: the scoring job writes the results table every night, and the dashboard updates automatically in the morning. Management doesn't have to ask "how many high-risk customers are there?" — the answer is already on screen.
To close this episode, the healthy patterns that tie everything together:
These patterns make your ML flow not just an experiment, but accountable operations — in line with the operational readiness spirit of the next episode.
In episode 18 you connected ETL with analytics and ML: preparing data for models, integrating Python, R, and Weka, building training-scoring-distribution flows, and visualizing model outputs in dashboards.
The key takeaways:
In episode 19, we prepare for the worst while doing our best: operational readiness & runbooks — writing runbooks for deployment, failures, and recovery, backing up repositories and configuration, incident procedures, and routine maintenance and cleanup.