Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Impute Missing Values

data.impute_missing_values

ProductionBounded custom (Class B)Deterministicstrictmoderatev1.0.0
No network

Overview

You send a rectangular table, the columns to fill, and a strategy: CONSTANT, MEAN, MEDIAN, or MOST_FREQUENT. CONSTANT requires constant and is the only way to fill an all-null column. MEAN and MEDIAN require INTEGER or NUMBER and promote INTEGER to NUMBER. A most-frequent tie keeps the first-seen value. The input table is copied. This is not interpolation, KNN, or a formula.

Filling nulls in place, or picking an arbitrary mode on a tie, makes a later checksum undebuggable. The table is copied and the fill value is reported.

Reliability

The input rows are not mutated. All-null columns require CONSTANT. DUPLICATE_COLUMN — trigger: columns repeats a name; retryable: no; next: send unique names. SHAPE_INVALID — trigger: a row is not rectangular; retryable: no; next: fix that row. TYPE_MISMATCH — trigger: a cell or constant does not match the column type; retryable: no; next: send a matching scalar. ITEM_LIMIT_EXCEEDED — trigger: the table exceeds 1,000,000 cells; retryable: no; next: split the table. COLUMN_CONFLICT — trigger: a requested column is not in the table; retryable: no; next: send a name that exists. IMPUTE_INVALID — trigger: constant missing or extra, MEAN/MEDIAN on a non-numeric column, or an all-null column without CONSTANT; retryable: no; next: pick CONSTANT or a numeric column.

Context footprint

A copied table plus one fill report per column. A successful call costs 2 execution credits.

When to use it

When selected columns should be filled with a declared constant, mean, median or first-seen mode, copying the table rather than editing it.

When missingness should be interpolated in time, or filled by a neighbour model.

Scope

Note
Fills null cells in named columns with a constant, mean, median, or first-seen mode, copying the table.

Non-goals

  • Does not interpolate or run KNN
  • Does not group before filling
  • Does not evaluate formulas

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

data-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input2 MB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
tableobjectYesClosed rectangular table: typed columns plus row-major arrays of JSON scalars or null.
columnsarrayYesFrom 1 through 256 unique columns to fill, each present in the table.
strategystringNoCONSTANT, MEAN, MEDIAN, or MOST_FREQUENT; omit it for MOST_FREQUENT.
constantobjectNoFill value matching the column type; required for CONSTANT and omitted otherwise.

Output schema

FieldTypeRequiredDescription
columnsarrayYesResult columns, INTEGER promoted to NUMBER after MEAN or MEDIAN, 0 through 256 names.
rowsarrayYesFrom 0 through 50,000 copied rows with nulls filled in the requested columns.
columnCountintegerYesNon-negative count for this result.
rowCountintegerYesNon-negative count for this result.
strategystringYesStrategy actually applied.
imputationsarrayYesOne fill report per requested column, length 1 through 256, in request order.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.impute_missing_values","input":{"table":{"columns":[{"name":"n","type":"INTEGER"}],"rows":[[1], [null], [3]]},"columns":["n"],"strategy":"MEAN"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("data.impute_missing_values", {"table":{"rows":[[1],[null],[3]],"columns":[{"type":"INTEGER","name":"n"}]},"strategy":"MEAN","columns":["n"]});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DUPLICATE_COLUMN400NoThe request payload failed this skill's input validation.
SHAPE_INVALID400NoThe request payload failed this skill's input validation.
TYPE_MISMATCH400NoThe request payload failed this skill's input validation.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
COLUMN_CONFLICT400NoThe request payload failed this skill's input validation.
IMPUTE_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not interpolate or run KNN
  • Does not group before filling
  • Does not evaluate formulas
  • Time-series interpolation
  • Model-based imputation

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "data.impute_missing_values",
  "input": {
    "table": {
      "rows": [
        [
          1
        ],
        [
          null
        ],
        [
          3
        ]
      ],
      "columns": [
        {
          "type": "INTEGER",
          "name": "n"
        }
      ]
    },
    "strategy": "MEAN",
    "columns": [
      "n"
    ]
  }
}

Examples

Mean promotes integer and fills one null

Inputjson
{
  "table": {
    "rows": [
      [
        1
      ],
      [
        null
      ],
      [
        3
      ]
    ],
    "columns": [
      {
        "type": "INTEGER",
        "name": "n"
      }
    ]
  },
  "strategy": "MEAN",
  "columns": [
    "n"
  ]
}
Expected outputjson
{
  "rows": [
    [
      1
    ],
    [
      2
    ],
    [
      3
    ]
  ],
  "rowCount": 3,
  "strategy": "MEAN",
  "imputations": [
    {
      "imputedCount": 1,
      "fillValue": 2,
      "column": "n"
    }
  ],
  "columns": [
    {
      "type": "NUMBER",
      "name": "n"
    }
  ],
  "columnCount": 1
}
Tip
Mean of 1 and 3 is 2.0 and the INTEGER column becomes NUMBER

Most frequent tie keeps first seen

Inputjson
{
  "table": {
    "rows": [
      [
        "a"
      ],
      [
        "b"
      ],
      [
        "a"
      ],
      [
        "b"
      ],
      [
        null
      ]
    ],
    "columns": [
      {
        "type": "STRING",
        "name": "c"
      }
    ]
  },
  "strategy": "MOST_FREQUENT",
  "columns": [
    "c"
  ]
}
Expected outputjson
{
  "rows": [
    [
      "a"
    ],
    [
      "b"
    ],
    [
      "a"
    ],
    [
      "b"
    ],
    [
      "a"
    ]
  ],
  "rowCount": 5,
  "strategy": "MOST_FREQUENT",
  "imputations": [
    {
      "imputedCount": 1,
      "fillValue": "a",
      "column": "c"
    }
  ],
  "columns": [
    {
      "type": "STRING",
      "name": "c"
    }
  ],
  "columnCount": 1
}
Tip
a and b both appear twice, so the first-seen value a is used
  • Fill a numeric amount with the column mean before a union
  • Resolve a most-frequent tie by first appearance on a STRING column

Avoid for

  • Time-series interpolation
  • Model-based imputation

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

imputetransformationdata