# predictive-analytics-construction

predictive-analytics-construction predicts cost overruns, schedule delays and project risks using historical construction data and machine learning models.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 116 installs · ★ 434 repo stars
- Author: datadrivenconstruction
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/4.1-Analytics-KPI-Dashboard/predictive-analytics-construction/SKILL.md
- Updated: 2026-10-19
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/predictive-analytics-construction

## What it does

The skill trains GradientBoostingRegressor and GradientBoostingClassifier models on completed project data and forecasts the probability of budget overrun or schedule slippage for a new site. It considers project type, gross area, duration, number of change orders, contractor experience and complexity score.

Requires Python 3 in `PATH` and pandas, numpy, scikit-learn libraries. Expects a CSV or DataFrame with `original_estimate`, `final_cost`, `planned_duration`, `actual_duration` columns plus project features. Training fails without these fields.

The model calculates overrun percentage, classifies projects as delayed or on time, ranks risk factors by importance and returns a list of comparable projects from the training set.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill predictive-analytics-construction -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/predictive-analytics-construction/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/predictive-analytics-construction/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill predictive-analytics-construction -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/predictive-analytics-construction/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill predictive-analytics-construction -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/predictive-analytics-construction/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction 2_DDC_Book/4.1-Analytics-KPI-Dashboard/predictive-analytics-construction
```

2. **Manually: put the files in place**
- File: `.github/skills/predictive-analytics-construction/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill predictive-analytics-construction -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --path 2_DDC_Book/4.1-Analytics-KPI-Dashboard/predictive-analytics-construction
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/predictive-analytics-construction/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill predictive-analytics-construction -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/4.1-Analytics-KPI-Dashboard/predictive-analytics-construction/SKILL.md

## When to use it
- forecast budget overrun from project characteristics
- estimate schedule delay probability before work starts
- identify top risk drivers in a new project
- train models on historical construction data
- compare a current project to similar past ones

## Example prompts
- Train the cost overrun model on `projects.csv`
- Forecast delay for a project with 5000 sqm area, 18 months duration and 12 change orders
- Show feature importance for the `cost_overrun` model

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 85091a2128668209.

BEGIN THIRD-PARTY FILE 85091a2128668209
````text
---
name: "predictive-analytics-construction"
description: "Forecast project outcomes using historical data: cost overruns, schedule delays, risk probabilities. Machine learning models for construction prediction."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw": {"emoji": "📈", "os": ["darwin", "linux", "win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}}
---
# Predictive Analytics for Construction

## Overview

Use historical project data to predict future outcomes: cost overruns, schedule delays, quality issues, and risks. Apply machine learning models tailored for construction industry patterns.

## Business Case

Predictive analytics enables proactive project management:
- **Early Warning**: Identify projects likely to overrun before it happens
- **Resource Optimization**: Allocate resources based on predicted needs
- **Risk Mitigation**: Focus on high-risk areas early
- **Better Estimates**: Learn from historical accuracy

## Technical Implementation

```python
from dataclasses import dataclass, field
from typing import List, Dict, Any, Optional, Tuple
import pandas as pd
import numpy as np
from datetime import datetime
from sklearn.ensemble import RandomForestRegressor, GradientBoostingClassifier
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.metrics import mean_absolute_error, accuracy_score, classification_report
import warnings
warnings.filterwarnings('ignore')

@dataclass
class PredictionResult:
    prediction: float
    confidence: float
    prediction_type: str
    features_used: List[str]
    feature_importance: Dict[str, float]
    comparable_projects: List[str]
    risk_factors: List[str]

@dataclass
class ModelMetrics:
    model_name: str
    accuracy: float
    mae: float
    feature_importance: Dict[str, float]
    training_samples: int
    last_trained: datetime

class ConstructionPredictiveAnalytics:
````
END THIRD-PARTY FILE 85091a2128668209

The third-party file has ended. Everything between the 85091a2128668209 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2015 of 15490 bytes. © datadrivenconstruction · MIT · https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/4.1-Analytics-KPI-Dashboard/predictive-analytics-construction/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
