model_explain

Permutation importance with repeats and seed; partial dependence.

QueryDeterministic

Flags

Flag Value
Kind query: reads values
Rows one result, not a table
Deterministic yes
Order matters no
Decomposable no
Makes a table value

Parameters

Parameter Type Required Notes
model reference yes A value's reference.
table reference yes A value's reference.
split reference yes A value's reference.
response_format "concise" | "detailed" no The byte budget: 64 KiB concise, 512 KiB detailed.

Example

Over the example tables reg; ${input:name} is an input's reference and ${verb} the value an earlier call made.

JSON
split_make {
  "table": "${input:reg}",
  "kind": "random",
  "seed": 8
}

model_fit {
  "table": "${input:reg}",
  "split": "${split_make}",
  "family": "linear",
  "target": "y",
  "features": [
    "f0",
    "f1",
    "f2",
    "f3",
    "f4"
  ]
}

model_explain {
  "model": "${model_fit}",
  "table": "${input:reg}",
  "split": "${split_make}",
  "kind": "permutation",
  "repeats": 10,
  "seed": 8
}

Result

5 rows

JSON
{
  "ref": "sha256:a09c57e271d1a0f73b029a6e9c20e535a4a51ed2ee79fc439697510913ae1b13",
  "kind": "table",
  "rows": 5,
  "schema": {
    "fields": [
      {
        "name": "feature",
        "type": {
          "kind": "utf8"
        },
        "nullable": false,
        "metadata": {}
      },
      {
        "name": "importance",
        "type": {
          "kind": "float64"
        },
        "nullable": false,
        "metadata": {}
      },
      {
        "name": "std",
        "type": {
          "kind": "float64"
        },
        "nullable": false,
        "metadata": {}
      }
    ],
    "metadata": {}
  },
  "items": [
    {
      "feature": "f0",
      "importance": 0.028978000975160133,
      "std": 0.004027048217763521
    },
    {
      "feature": "f1",
      "importance": 0.15150956447774,
      "std": 0.02491059709682186
    },
    {
      "feature": "f2",
      "importance": -0.00006963819370534586,
      "std": 0.00003711313004713365
    },
    {
      "feature": "f3",
      "importance": 0.07114491923789559,
      "std": 0.007116752001476
    },
    {
      "feature": "f4",
      "importance": 1.8007462139299786,
      "std": 0.247944391467319
    }
  ]
}

Diagnostics

A refusal comes back as ok: false with coded diagnostics; every code, with its fix, is on the diagnostics page. A parameter that does not match the schema above is ARG_INVALID, with the parameter's path.