Manufacturing and industrial assets
Predict equipment failures, estimate repair costs, and detect skipped maintenance and parts consumption above specification.
Data mapping
- Entity
- machine or asset
- Group
- plant or line
- Profile
- generic; configure time windows with verticals.register
Supported analyses
- Will this asset fail within 30 days?
predict_event(target="breakdown", window_days=30) - What is the expected cost of the next repair?
predict_value(target="breakdown", window_days=90)
Reference implementation
from datetime import datetime, timedelta
from vertiq import plugins, rules
from vertiq.mapping import Mapping, apply, repair
from vertiq.tasks import predict_event, predict_value
# rows: the source export as a list of dicts, e.g. list(csv.DictReader(open("export.csv")))
mapping = Mapping.parse({"entity": "Equipment No", "time": "Work Order Date", "type": "Order Type", "value": "Cost", "group": "Plant", "attrs": ["Fault Code", "PM Done", "Technician Note"], "date_format": "%Y-%m-%d"})
m, notes = repair(mapping, rows) # validates column names, value types and date format against the rows
ds, problems = apply(m, rows) # rows that fail to load are reported, not imputed
@plugins.feature("plants")
def skipped_pm_60(entity, before, cut): # receives only events recorded before the cutoff
return {"skipped_pm_60": sum(1 for e in before if e.type == "pm"
and e.attrs.get("PM Done") == "no"
and e.at >= cut - timedelta(days=60))}
task = predict_event(ds, target="breakdown", window_days=30, pack="plants")
print(task.status, task.report()) # "trained" only if the model outperformed the baseline on held-out entities
if task.status == "trained":
print(task.score("EQ-602")) # probability with contributing factors
size = predict_value(ds, target="breakdown", window_days=90, pack="plants")
print(size.status, size.report())
flags = rules.run(ds, [
rules.repeat(30, key="Fault Code", type="breakdown"), # the same fault code within 30 days
rules.exceeds({"SEAL": {"seal kit": 1}}, key="Fault Code"), # parts consumption above the bill of materials
rules.too_short("Technician Note", 2), # technician notes too short to be useful
])
print(flags["summary"])
This code is executed by the test suite (tests/test_guides.py) against generated records with these column names.
Recommended plugin
skipped_pm_60: Skipped preventive maintenance increases failure risk. This is the relationship tested in the equipment benchmark.
Validation rules
rules.repeat(30, key="Fault Code", type="breakdown"): the same fault code within 30 daysrules.exceeds({"SEAL": {"seal kit": 1}}, key="Fault Code"): parts consumption above the bill of materialsrules.too_short("Technician Note", 2): technician notes too short to be useful
Related modules
inventory: spare-parts reorder points from consumption and lead timetasks.predict_uplift: the effect of a maintenance programme, from machines kept on the old scheduledrift: whether sensor-derived features or failure rates have moved since the model was evaluated
Implementation notes
- exceeds() reads parts from event.items. Build those events from the parts consumption table.
Validation
- Equipment failure: AUC 0.674 for the rule baseline, 0.735 for the generic task, 0.767 with one plugin, 5 runs
- Manufacturing tables, a domain excluded from Vertiq LM training
- Every deployment: the evaluation gate measures each model on the organisation's own held-out records before promotion.