Risk Analytics Pipeline
An end-to-end pipeline that integrates HR, payroll, and operational data across multiple enterprise systems using SQL and Snowflake, then trains a Python predictive model that reaches 95% accuracy for enterprise risk forecasting.
The problem
Workforce and operational data lived in separate systems — HR, payroll, and business-unit tools — each with its own employee identifiers, department codes, and location formats. Executive reporting was slow to produce and hard to trust: the same employee could appear under three different ID formats depending on the source system, and nobody had a single validated view of risk exposure across the organization.
How it's built
The pipeline runs in three stages, each owned end to end — from raw source extraction through the model that leadership actually reads.
Integrate
SQL pipelines in Snowflake join employee IDs, department codes, and location identifiers across HR, payroll, and operational sources, with cleansing and standardization at every join.
Model
A Python Random Forest model trains on the unified dataset — engineered features, validated splits, tuned for stability — to forecast operational risk.
Deliver
Predictions and validated data feed automated executive dashboards, replacing manual reporting with a repeatable, trusted pipeline.
SQL & the database layer
Snowflake serves as the enterprise warehouse. The core integration query standardizes identifiers across source systems before any downstream reporting or modeling touches the data:
-- unify workforce records across HR, payroll, and operations
CREATE OR REPLACE TABLE risk.workforce_unified AS
SELECT
h.employee_id,
COALESCE(p.dept_code, h.dept_code) AS department_code,
COALESCE(o.location_id, h.location_id) AS location_id,
h.hire_date,
p.overtime_hours,
o.incident_count,
o.turnover_flag
FROM hr.employee_roster h
LEFT JOIN payroll.hours_summary p
ON h.employee_id = p.employee_id
LEFT JOIN ops.incident_log o
ON h.employee_id = o.employee_id
AND h.location_id = o.location_id
WHERE h.status = 'active';
Python & the predictive model
The unified table feeds a Random Forest classifier that flags elevated operational risk. Feature engineering pulls from tenure, overtime load, incident history, and department-level trends; the model is validated on a held-out split before every deployment.
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
X_train, X_test, y_train, y_test = train_test_split(
features, labels, test_size=0.2, random_state=42
)
model = RandomForestClassifier(
n_estimators=300, max_depth=12, random_state=42
)
model.fit(X_train, y_train)
preds = model.predict(X_test)
print(accuracy_score(y_test, preds)) # 0.95
Results
The pipeline replaced a manual, spreadsheet-driven process with a repeatable one — and gave leadership a forecasting signal that didn't exist before.
Want the details behind the numbers?
Happy to walk through the schema, the model, or the reporting it feeds.
Email Me Back to Projects