risk-assessment-ml
Apply machine learning for construction project risk assessment. Predict schedule delays, cost overruns, and safety incidents using historical data and project characteristics.
Install / Use
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill risk-assessment-mlInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of risk-assessment-ml
risk-assessment-ml scores 91/100 on our quality scale, 349th of 944 AI & Machine Learning skills we index (top 37%).
Its SKILL.md is 16 KB long, well organised into 15 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
It has 333 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 3 months ago, so risk-assessment-ml is actively maintained.
- Our last check on 2026-11-20 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
risk-assessment-ml compared with similar skills
All 4 of these similar skills score higher than risk-assessment-ml; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| risk-assessment-ml (this skill)by datadrivenconstruction | 91 | 333 | 3mo ago | SKILL.md |
| claude-memby thedotmack | 100 | 118.5k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 113.3k | 12d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 93.3k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 80.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install risk-assessment-ml?
- Run
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill risk-assessment-ml. The install tabs above show the steps for each supported agent. - Which AI agents does risk-assessment-ml work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is risk-assessment-ml safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is risk-assessment-ml still maintained?
- The repository was last updated about 3 months ago, so risk-assessment-ml is actively maintained.
Skill content
View source on GitHubname: "risk-assessment-ml" description: "Apply machine learning for construction project risk assessment. Predict schedule delays, cost overruns, and safety incidents using historical data and project characteristics." homepage: "https://datadrivenconstruction.io" metadata: {"openclaw": {"emoji": "🚀", "os": ["darwin", "linux", "win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}}
Risk Assessment with Machine Learning
Overview
This skill implements ML-based risk assessment for construction projects. Predict potential risks before they occur and prioritize mitigation strategies based on data-driven insights.
Risk Categories:
- Schedule Risk: Delays, critical path impacts
- Cost Risk: Budget overruns, change orders
- Safety Risk: Incident probability, hazard identification
- Quality Risk: Defects, rework probability
Quick Start
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier, GradientBoostingRegressor
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
# Load historical project data
projects = pd.read_csv("project_history.csv")
# Features for risk prediction
features = ['project_size_m2', 'budget_usd', 'duration_days',
'complexity_score', 'team_size', 'similar_projects_exp']
X = projects[features]
y_delay = projects['had_delay'] # Binary: 1=delay, 0=on-time
# Train risk model
X_train, X_test, y_train, y_test = train_test_split(X, y_delay, test_size=0.2)
model = RandomForestClassifier(n_estimators=100, random_state=42)
model.fit(X_train, y_train)
# Predict risk for new project
new_project = [[5000, 2000000, 365, 3, 50, 5]]
risk_probability = model.predict_proba(new_project)[0][1]
print(f"Delay Risk: {risk_probability:.1%}")
Comprehensive Risk Model
Risk Assessment Framework
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier, GradientBoostingRegressor
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import cross_val_score
from dataclasses import dataclass
from typing import Dict, List, Optional
import joblib
@dataclass
class RiskPrediction:
category: str
probability: float
severity: str
impact_days: Optional[float]
impact_cost: Optional[float]
confidence: float
contributing_factors: List[str]
recommended_actions: List[str]
class ConstructionRiskAssessor:
"""ML-based construction risk assessment"""
def __init__(self):
self.models = {}
self.scalers = {}
self.encoders = {}
self.feature_importance = {}
def prepare_features(self, df: pd.DataFrame) -> pd.DataFrame:
"""Prepare features for training/prediction"""
features = df.copy()
# Encode categorical variables
categorical_cols = features.select_dtypes(include=['object']).columns
for col in categorical_cols:
if col not in self.encoders:
self.encoders[col] = LabelEncoder()
features[col] = self.encoders[col].fit_transform(features[col].astype(str))
else:
features[col] = self.encoders[col].transform(features[col].astype(str))
# Handle missing values
features = features.fillna(features.median())
return features
def train_delay_model(self, df: pd.DataFrame, target_col: str = 'delay_days'):
"""Train schedule delay prediction model"""
features = self.prepare_features(df.drop(columns=[target_col]))
target = df[target_col]
# Binary classification: delay or not
target_binary = (target > 0).astype(int)
# Scale features
self.scalers['delay'] = StandardScaler()
X_scaled = self.scalers['delay'].fit_transform(features)
# Train model
self.models['delay_classifier'] = RandomForestClassifier(
n_estimators=100,
max_depth=10,
random_state=42
)
self.models['delay_classifier'].fit(X_scaled, target_binary)
# Train regression for delay magnitude
delayed_mask = target > 0
if delayed_mask.sum() > 10:
self.models['delay_regressor'] = GradientBoostingRegressor(
n_estimators=100,
max_depth=5,
random_state=42
)
self.models['delay_regressor'].fit(
X_scaled[delayed_mask],
target[delayed_mask]
)
# Store feature importance
self.feature_importance['delay'] = dict(zip(
features.columns,
self.models['delay_classifier'].feature_importances_
))
return self._evaluate_model('delay_classifier', X_scaled, target_binary)
def train_cost_overrun_model(self, df: pd.DataFrame,
target_col: str = 'cost_overrun_pct'):
"""Train cost overrun prediction model"""
features = self.prepare_features(df.drop(columns=[target_col]))
target = df[target_col]
# Binary: overrun or not
target_binary = (target > 0).astype(int)
self.scalers['cost'] = StandardScaler()
X_scaled = self.scalers['cost'].fit_transform(features)
self.models['cost_classifier'] = RandomForestClassifier(
n_estimators=100,
max_depth=10,
random_state=42
)
self.models['cost_classifier'].fit(X_scaled, target_binary)
# Regression for magnitude
overrun_mask = target > 0
if overrun_mask.sum() > 10:
self.models['cost_regressor'] = GradientBoostingRegressor(
n_estimators=100,
max_depth=5,
random_state=42
)
self.models['cost_regressor'].fit(
X_scaled[overrun_mask],
target[overrun_mask]
)
self.feature_importance['cost'] = dict(zip(
features.columns,
self.models['cost_classifier'].feature_importances_
))
return self._evaluate_model('cost_classifier', X_scaled, target_binary)
def train_safety_model(self, df: pd.DataFrame,
target_col: str = 'incident_occurred'):
"""Train safety incident prediction model"""
features = self.prepare_features(df.drop(columns=[target_col]))
target = df[target_col]
self.scalers['safety'] = StandardScaler()
X_scaled = self.scalers['safety'].fit_transform(features)
self.models['safety_classifier'] = RandomForestClassifier(
n_estimators=100,
max_depth=8,
class_weight='balanced', # Handle imbalanced data
random_state=42
)
self.models['safety_classifier'].fit(X_scaled, target)
self.feature_importance['safety'] = dict(zip(
features.columns,
self.models['safety_classifier'].feature_importances_
))
return self._evaluate_model('safety_classifier', X_scaled, target)
def _evaluate_model(self, model_name: str, X: np.ndarray, y: np.ndarray) -> Dict:
"""Evaluate model with cross-validation"""
model = self.models[model_name]
scores = cross_val_score(model, X, y, cv=5, scoring='accuracy')
return {
'model': model_name,
'accuracy_mean': scores.mean(),
'accuracy_std': scores.std()
}
def predict_risks(self, project_data: Dict) -> List[RiskPrediction]:
"""Predict all risks for a project"""
df = pd.DataFrame([project_data])
features = self.prepare_features(df)
predictions = []
# Schedule risk
if 'delay_classifier' in self.models:
X_delay = self.scalers['delay'].transform(features)
delay_prob = self.models['delay_classifier'].predict_proba(X_delay)[0][1]
delay_days = None
if delay_prob > 0.5 and 'delay_regressor' in self.models:
delay_days = self.models['delay_regressor'].predict(X_delay)[0]
predictions.append(RiskPrediction(
category='Schedule',
probability=delay_prob,
severity=self._get_severity(delay_prob),
impact_days=delay_days,
impact_cost=delay_days * project_data.get('daily_cost', 10000) if delay_days else None,
confidence=0.85,
contributing_factors=self._get_top_factors('delay', features.iloc[0]),
recommended_actions=self._get_delay_actions(delay_prob)
))
# Cost risk
if 'cost_classifier' in self.models:
X_cost = self.scalers['cost'].transform(features)
cost_prob = self.models['cost_classifier'].predict_proba(X_cost)[0][1]
overrun_pct = None
if cost_prob > 0.5 and 'cost_regressor' in self.models:
overrun_pct = self.models['cost_regressor'].predict(X_cost)[0]
predictions.append(RiskPrediction(
category='Cost',
probability=cost_prob,
severity=self._get_severity(cost_prob),
impact_days=None,
impact_cost=project_data.get('budget', 0) * overrun_pct / 100 if overrun_pct else None,
confidence=0.80,
contributing_factors=self._get_top_factors('cost', features.iloc[0]),
recommended_actions=self._get_cost_actions(cost_prob)
))
# Safety risk
if 'safety_classifier' in self.models:
X_safety = self.scalers['safety'].transform(features)
safety_prob = self.models['safety_classifier'].predict_proba(X_safety)[0][1]
predictions.append(RiskPrediction(
category='Safety',
probability=safety_prob,
severity=self._get_severity(safety_prob),
impact_days=None,
impact_cost=None,
confidence=0.75,
contributing_factors=self._get_top_factors('safety', features.iloc[0]),
recommended_actions=self._get_safety_actions(safety_prob)
))
return predictions
def _get_severity(self, probability: float) -> str:
if probability >= 0.7:
return 'High'
elif probability >= 0.4:
return 'Medium'
else:
return 'Low'
def _get_top_factors(self, risk_type: str, project_features: pd.Series) -> List[str]:
"""Get top contributing factors for risk"""
importance = self.feature_importance.get(risk_type, {})
sorted_factors = sorted(importance.items(), key=lambda x: x[1], reverse=True)
return [f[0] for f in sorted_factors[:5]]
def _get_delay_actions(self, probability: float) -> List[str]:
actions = []
if probability > 0.7:
actions.extend([
'Add buffer to critical path activities',
'Increase resource allocation',
'Implement daily progress monitoring'
])
elif probability > 0.4:
actions.extend([
'Review schedule with contractors',
'Identify potential fast-track opportunities'
])
else:
actions.append('Standard schedule monitoring')
return actions
def _get_cost_actions(self, probability: float) -> List[str]:
actions = []
if probability > 0.7:
actions.extend([
'Increase contingency reserve',
'Lock in material prices',
'Review scope with stakeholders'
])
elif probability > 0.4:
actions.extend([
'Monitor change order frequency',
'Implement value engineering review'
])
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
118.5kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
113.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
93.3kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
80.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
