Skip to main content

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

MicroSkills Reference

Detect Outliers

data.detect_outliers

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send 1 through 100,000 finite numbers. IQR uses type-7 quartiles and iqrMultiplier 1.5 unless you override it in [0, 10]. ROBUST_Z uses median and MAD scaled by 1.482602218505602, with threshold 3.5 in (0, 20]. Constant data returns no outliers and does not divide by zero. Method-specific options on the wrong method are refused. This does not remove points or train a model.

A z-score that divides by a zero MAD invents outliers on a flat series. Fences and scaled MAD stay defined, and the constant case is empty.

Reliability

Quartiles are Hyndman-Fan type 7. MAD is scaled by 1.482602218505602. TYPE_MISMATCH — trigger: a non-null value is not a finite number; retryable: no; next: send JSON numbers only. SERIES_INVALID — trigger: a null under REJECT, or no finite numbers remain after OMIT; retryable: no; next: send finite values or switch to OMIT. OUTLIER_OPTIONS_INVALID — trigger: threshold is sent with IQR, or iqrMultiplier with ROBUST_Z; retryable: no; next: send only the option that belongs to the method.

Context footprint

Fences plus at most 500 outlier rows. A successful call costs 1 execution credit.

When to use it

When a univariate numeric vector needs Tukey fences or a MAD z-score, including the constant-vector case that must not divide by zero.

When you want the points removed in the same call, or a multivariate detector.

Scope

Note
Identifies univariate outlier indexes with Tukey IQR fences or a scaled-MAD z-score.

Non-goals

  • Does not remove or impute the points
  • Does not detect multivariate anomalies
  • Does not train a model

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

data-transformation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

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
valuesarrayYesFrom 1 through 100,000 numbers or nulls in caller order; indexes are preserved.
methodstringNoIQR uses Tukey fences; ROBUST_Z uses scaled MAD. Omit it for IQR.
optionsobjectNoClosed method options: iqrMultiplier for IQR or threshold for ROBUST_Z, never both. Omit it for 1.5 and 3.5.
nullPolicystringNoREJECT fails on null; OMIT skips nulls. Omit it for REJECT.
maxOutliersintegerNoHow many outliers to return; omit it for 500.

Output schema

FieldTypeRequiredDescription
methodstringYesMethod actually applied.
centernumberYesSample median of the finite values.
dispersionnumberYesIQR or scaled MAD; 0 when the series is constant.
lowerBoundnumberYesLower fence or robust lower bound.
upperBoundnumberYesUpper fence or robust upper bound.
countintegerYesNon-negative count for this result.
omittedCountintegerYesNon-negative count for this result.
truncatedbooleanYesTrue when more outliers exist than maxOutliers.
outliersarrayYesFrom 0 through 500 closed {index, value, score} outliers in original-index order, empty when the series is constant.

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.detect_outliers","input":{"values":[1,2,3,4,100]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("data.detect_outliers", {"values":[1,2,3,4,100]});

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.
TYPE_MISMATCH400NoThe request payload failed this skill's input validation.
SERIES_INVALID400NoThe request payload failed this skill's input validation.
OUTLIER_OPTIONS_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not remove or impute the points
  • Does not detect multivariate anomalies
  • Does not train a model
  • Dropping the outliers in the same call
  • Multivariate robust distance

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "data.detect_outliers",
  "input": {
    "values": [
      1,
      2,
      3,
      4,
      100
    ]
  }
}

Examples

Iqr flags a distant hundred

Inputjson
{
  "values": [
    1,
    2,
    3,
    4,
    100
  ]
}
Expected outputjson
{
  "truncated": false,
  "upperBound": 7,
  "method": "IQR",
  "center": 3,
  "lowerBound": -1,
  "count": 5,
  "omittedCount": 0,
  "dispersion": 2,
  "outliers": [
    {
      "score": 46.5,
      "value": 100,
      "index": 4
    }
  ]
}
Tip
Type-7 Q1=2 Q3=4 so 100 sits 46.5 IQR units above the upper fence

Constant series has no robust z outliers

Inputjson
{
  "values": [
    5,
    5,
    5
  ],
  "method": "ROBUST_Z"
}
Expected outputjson
{
  "truncated": false,
  "upperBound": 5,
  "method": "ROBUST_Z",
  "center": 5,
  "lowerBound": 5,
  "count": 3,
  "omittedCount": 0,
  "dispersion": 0,
  "outliers": []
}
Tip
Scaled MAD is 0, so the skill returns empty outliers rather than dividing
  • Flag a 100 in an otherwise 1-through-10 series before a chart
  • Confirm a constant series produces no divide-by-zero outliers

Avoid for

  • Dropping the outliers in the same call
  • Multivariate robust distance

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

outliersstatisticsdata