Feature Engineering
Feature Engineering
Before training a model, you usually reshape the raw columns into good features. Ciaren's Machine Learning nodes cover the common steps — scaling, encoding, selection, and dimensionality reduction — and each one previews on real rows so you can see the effect immediately.
You'll use: File Input → Fill Nulls → Encode Categories → Scale Features → Select Features → Reduce Dimensions (PCA).
Sample data
Save this as applicants.csv and upload it on the Datasets page
(📥 download applicants.csv):
applicant_id,age,income,region,score,approved
1,25,42000,North,0.61,0
2,41,88000,South,0.82,1
3,33,,North,0.55,0
4,52,120000,East,0.91,1
5,29,51000,South,0.64,0
6,46,99000,East,0.88,1
Build the flow
- File Input — File type CSV, select the
applicants.csvdataset. - Fill Nulls —
strategy: "median",columns: ["income"]. (Use the standard cleaning Fill Nulls node — it works on both engines.) - Encode Categories —
method: "onehot",columns: ["region"]. Creates dummy columns likeregion_North,region_South,region_East. - Scale Features —
method: "standard"(z-score) over["age", "income"]. Other options areminmaxandrobust. - Select Features —
method: "kbest"against theapprovedtarget to keep the most relevant columns (or use avariancethreshold /correlationfilter). - Reduce Dimensions — PCA; keep a number of components or a variance fraction.
The selected columns are replaced by
pc_1,pc_2, ….
Preview after each node to watch the feature space change. This flow ends at a feature-prep node, so to Run or export it as a whole, add a terminal — a File Output to save the engineered table, or feed the features into a Train node (see below). A flow needs at least one output or model-terminal node to run; on its own it's ideal for live preview.
Scaling, visualized
After Fill Nulls (row 3's missing income becomes the median, 88000):
| age | income |
|---|---|
| 25 | 42000 |
| 41 | 88000 |
| 33 | 88000 |
| 52 | 120000 |
| 29 | 51000 |
| 46 | 99000 |
| agenew | incomenew |
|---|---|
| -1.33 | -1.46 |
| 0.35 | 0.25 |
| -0.49 | 0.25 |
| 1.51 | 1.43 |
| -0.91 | -1.12 |
| 0.88 | 0.66 |
Engineer features inside the model instead
For modeling, you often want the same transformations reapplied automatically at
predict time. Rather than wiring scaling/encoding/imputation as separate nodes,
open a train node's Advanced → Preprocessing options — Ciaren bundles numeric
scaling, imputation, and one-hot encoding into the model Pipeline, so the exported
scikit-learn script reproduces them exactly when scoring new data.
The standalone nodes above are ideal for exploration and preview; the in-model preprocessing is ideal for production scoring.
Next steps
- Customer Churn Classification — train on these features
- ML Nodes Reference
- Fill Nulls