This project predicts which employees of a fictional company are at risk of leaving using Random Forest and Cross Validation. Weight by Information Gain ranks the driving factors, and the decision threshold is lowered so that more at-risk employees are caught.
Business Goal
Identify employees at risk of leaving and the factors that drive it. Application area: Human Resources. Project level: advanced.
RapidMiner Tools and Operators
The process is built with these operators:
- Read CSV
- Remap Binominals
- Multiply
- Weight by Information Gain
- Cross Validation
- Random Forest
- Apply Model
- Create Threshold
- Apply Threshold
- Performance (Binominal Classification)
- Performance to Data
- Weights to Data
- Write CSV
What You Will Learn
- Practise Random Forest and Cross Validation on imbalanced data
- Understand the role of the decision threshold in recall and precision
- Turn attribute weights into concrete retention programs
Working Steps
- Read the employee data — Read CSV loads data_karyawan.csv (3,000 employees, 12 attributes). id_karyawan becomes the id and keluar the binominal label (yes/no).
- Define the positive class — Remap Binominals makes "ya" (left the company) the positive class so precision and recall measure how well at-risk employees are found.
- Duplicate the data — Multiply sends the data down two paths: attribute weighting and cross validation.
- Weight the attributes — Weight by Information Gain scores how strongly each attribute separates leavers from stayers. Weights to Data and Write CSV save the weight list.
- Train Random Forest inside Cross Validation — Cross Validation with 10 folds (stratified). The Training part holds Random Forest with 100 trees, gain ratio criterion and maximal depth 10.
- Lower the decision threshold — Because leavers are a minority, a 0.5 threshold makes nearly everyone predicted to stay. Create Threshold (0.3) and Apply Threshold flag an employee as at risk when the probability of leaving is at least 30%.



