How rishirxt/offshoremodel works
This repository is a batch PPE-violation attribution model: it trains an XGBoost classifier, evaluates it, and ranks expanded candidate records before applying safety rules to produce a named or group alert. The documented workflow starts from prepared CSV data; the sampled code does not show camera, wearable, or roster data ingestion. Training, evaluation, and prediction are separate script entry points, with shared feature and path configuration. Edges are limited to calls and data flows shown in excerpts or explicitly documented in the README.
Main entry points: predict.py Candidate inference · evaluate.py Model evaluation · train.py Model training · config.py Model configuration
Components 11
Modeling
- Training features
data/training_features.csv - Model training
src/train.py - Model configuration
src/config.py - Trained model
Attribution
- Expanded candidates
data/expanded_candidates.csv - Candidate inference
src/predict.py - Safety rule engine
src/rules.py - Ranked alert decision
Evaluation
- Model evaluation
src/evaluate.py - Evaluation artifacts
Other components
- Operator
Connections 15
- Operator → Model training: runs training
readme.md - Operator → Model evaluation: runs evaluation
readme.md - Operator → Candidate inference: runs prediction
readme.md - Model training → Model configuration: loads settings
src/train.py - Model training → Training features: reads features
src/train.py - Model training → Trained model: saves model
src/train.py - Candidate inference → Model configuration: loads settings
src/predict.py - Candidate inference → Expanded candidates: reads candidates
src/predict.py - Candidate inference → Trained model: loads model
src/predict.py - Candidate inference → Safety rule engine: applies rules
src/predict.py - Candidate inference → Ranked alert decision: ranks decisions
src/predict.py - Model evaluation → Model configuration: loads settings
src/evaluate.py - Model evaluation → Training features: reads test data
src/evaluate.py - Model evaluation → Trained model: loads model
src/evaluate.py - Model evaluation → Evaluation artifacts: writes metrics
src/evaluate.py