Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Navigate to the storedModel in the MOC UI (under Models).

  2. Click on Schemas.

  3. Choose the schema you wish to edit from the menu on the left.

  4. You should see two views of the schema: a Table view (most helpful for extended schemas), and a JSON view:

    Image Removed

...

  1. Click on either Edit Table or Edit JSON.

...

  1. If selecting Edit Table, use the UI to modify the schema as required:

...

  1. Click on Save Changes. Edits made to one object (JSON/Table) will be reflected in the other once they are saved.

Model Execution

If the ModelOp Runtime is used for Model Execution, the schema can be used to enforce that all input and output records adhere to the data “contract” between the data pipelines and the model code.

...

Expand
titleinput_schema.avsc
Code Block
languagejson
{
    "type": "record",
    "name": "inferred_schema",
    "fields": [
        {
            "name": "UUID",
            "type": "string",
            "dataClass": "categorical",
            "role": "identifier",
            "protectedClass": false,
            "driftCandidate": false,
            "specialValues": [],
            "scoringOptional": false,
            "pii": true
        },
        {
            "name": "amount",
            "type": [
                "int",
                "double"
            ],
            "dataClass": "numerical",
            "role": "predictor",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": false,
            "phi": true
        },
        {
            "name": "home_ownership",
            "type": "string",
            "dataClass": "categorical",
            "role": "predictor",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": false
        },
        {
            "name": "age",
            "type": "string",
            "dataClass": "categorical",
            "role": "predictor",
            "protectedClass": true,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": true
        },
        {
            "name": "credit_age",
            "type": [
                "null",
                "int"
            ],
            "dataClass": "numerical",
            "role": "predictor",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": false
        },
        {
            "name": "employed",
            "type": "boolean",
            "dataClass": "categorical",
            "role": "predictor",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": false
        },
        {
            "name": "label",
            "type": "int",
            "dataClass": "categorical",
            "role": "label",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": true
        },
        {
            "name": "prediction",
            "type": "int",
            "dataClass": "categorical",
            "role": "score",
            "protectedClass": false,
            "driftCandidate": true,
            "specialValues": [],
            "scoringOptional": true
        }
    ]
}

...

"identifier", "predictor", "non_predictor", "prediction_date", "weight", "score", "label".

Reserved field names

...

"id", "UUID": "role" is set to "identifier"

...

"score", "prediction": "role" is set to "score"

...

"label", "ground_truth": "role" is set to "label"

...

NOTE: "prediction_date" is used to help graph metrics over time. The role should apply to a proper DateTime field and there should only be one "prediction_date" field per Schema. When properly used, the "prediction_date" field allows the OOTB monitors and custom monitors to calculate the given metric (e.g. AUC) for each distinct day within the provided Model data set.

Reserved field names

  • "id", "UUID": "role" is set to "identifier"

  • "score", "prediction": "role" is set to "score"

  • "label", "ground_truth": "role" is set to "label"

  • All other fields are set to "role": "predictor".

contains PII

"pii" is used to indicate that the field contains PII. The allowed values are TRUE or FALSE. By setting this value to TRUE for any field in a data set, the Model Implementation, and any associated Use Case will have the PII/PHI flag set to TRUE within the Use Case.

contains PHI

"phi" is used to indicate that the field contains PII. The allowed values are TRUE or FALSE. By setting this value to TRUE for any field in a data set, the Model Implementation, and any associated Use Case will have the PII/PHI flag set to TRUE within the Use Case.

protectedClass

"protectedClass" is a boolean field used to indicate whether or not a certain field corresponds to a protected attribute. Certain fields can be set as protected OOTB, such as "name": "gender". Others are harder to infer and must be assigned manually.

...

Any of the two values occurring in the label column (or score column).

Next Article: Adding / Managing Model Versions (Snapshots) >