{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/margin_driver_contribution/v1.json",
  "title": "margin_driver_contribution contract v1",
  "type": "object",
  "required": [
    "driver_cost_growth_pct",
    "driver_delay_hours",
    "driver_labour_hours",
    "driver_variation_count",
    "fact_class",
    "financial_period",
    "model_version",
    "predicted_margin_pct",
    "project_id"
  ],
  "properties": {
    "fact_class": {
      "type": "string",
      "description": "provenance marker distinguishing a model output from an observed fact",
      "x-demiton-requiredness": "required"
    },
    "project_id": {
      "type": "string",
      "description": "the project the prediction is about; the fact's subject anchor",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "model_version": {
      "type": "string",
      "description": "the fitted model version that produced these values; part of the fact identity",
      "x-demiton-requiredness": "required"
    },
    "feature_values": {
      "type": "object",
      "description": "the raw feature inputs the contributions were derived from",
      "x-demiton-requiredness": "optional"
    },
    "training_as_of": {
      "type": "string",
      "description": "the transaction-time cutoff the model trained on",
      "x-demiton-requiredness": "optional",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "legal_entity_id": {
      "type": "string",
      "description": "the legal entity whose project the prediction belongs to",
      "x-demiton-requiredness": "optional",
      "x-demiton-reference": true
    },
    "n_training_rows": {
      "type": "integer",
      "description": "number of project rows the model fitted on",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "count"
    },
    "financial_period": {
      "type": "string",
      "description": "the period the prediction is made for; part of the grain",
      "x-demiton-requiredness": "required",
      "x-demiton-reference": true
    },
    "driver_delay_hours": {
      "type": "number",
      "description": "predicted margin contribution attributed to site delay hours",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "hours",
      "x-demiton-type": "decimal"
    },
    "driver_labour_hours": {
      "type": "number",
      "description": "predicted margin contribution attributed to labour hours",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "hours",
      "x-demiton-type": "decimal"
    },
    "predicted_margin_pct": {
      "type": "number",
      "description": "the model's predicted project margin at the scoring cut",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "pct",
      "x-demiton-type": "decimal"
    },
    "driver_cost_growth_pct": {
      "type": "number",
      "description": "predicted margin contribution attributed to cost growth",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "pct",
      "x-demiton-type": "decimal"
    },
    "driver_variation_count": {
      "type": "number",
      "description": "predicted margin contribution attributed to variation signals",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "dimensionless",
      "x-demiton-type": "decimal"
    }
  },
  "x-demiton-register-type": "margin_driver_contribution",
  "x-demiton-contract-version": "1.0.1",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "legal_entity",
      "requirement": "optional",
      "role": "context"
    },
    {
      "axis": "financial_period",
      "requirement": "required",
      "role": "context"
    }
  ],
  "x-demiton-measures": [
    {
      "key": "driver_cost_growth_pct",
      "accumulation": "predictive",
      "dtype": "float",
      "unit": "pct"
    },
    {
      "key": "driver_delay_hours",
      "accumulation": "predictive",
      "dtype": "float",
      "unit": "hours"
    },
    {
      "key": "driver_labour_hours",
      "accumulation": "predictive",
      "dtype": "float",
      "unit": "hours"
    },
    {
      "key": "driver_variation_count",
      "accumulation": "predictive",
      "dtype": "float",
      "unit": "dimensionless"
    },
    {
      "key": "predicted_margin_pct",
      "accumulation": "predictive",
      "dtype": "float",
      "unit": "pct"
    }
  ],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "Predicted contribution of each cost or revenue driver to a project's margin, by period.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/margin_driver_contribution/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}