Detect Outliers
data.detect_outliers
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
Non-goals
- Does not remove or impute the points
- Does not detect multivariate anomalies
- Does not train a model
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| values | array | Yes | From 1 through 100,000 numbers or nulls in caller order; indexes are preserved. |
| method | string | No | IQR uses Tukey fences; ROBUST_Z uses scaled MAD. Omit it for IQR. |
| options | object | No | Closed method options: iqrMultiplier for IQR or threshold for ROBUST_Z, never both. Omit it for 1.5 and 3.5. |
| nullPolicy | string | No | REJECT fails on null; OMIT skips nulls. Omit it for REJECT. |
| maxOutliers | integer | No | How many outliers to return; omit it for 500. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| method | string | Yes | Method actually applied. |
| center | number | Yes | Sample median of the finite values. |
| dispersion | number | Yes | IQR or scaled MAD; 0 when the series is constant. |
| lowerBound | number | Yes | Lower fence or robust lower bound. |
| upperBound | number | Yes | Upper fence or robust upper bound. |
| count | integer | Yes | Non-negative count for this result. |
| omittedCount | integer | Yes | Non-negative count for this result. |
| truncated | boolean | Yes | True when more outliers exist than maxOutliers. |
| outliers | array | Yes | From 0 through 500 closed {index, value, score} outliers in original-index order, empty when the series is constant. |
API contract
POST /v1/executecurl -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]}}'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
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| TYPE_MISMATCH | 400 | No | The request payload failed this skill's input validation. |
| SERIES_INVALID | 400 | No | The request payload failed this skill's input validation. |
| OUTLIER_OPTIONS_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"skillKey": "data.detect_outliers",
"input": {
"values": [
1,
2,
3,
4,
100
]
}
}Examples
Iqr flags a distant hundred
{
"values": [
1,
2,
3,
4,
100
]
}{
"truncated": false,
"upperBound": 7,
"method": "IQR",
"center": 3,
"lowerBound": -1,
"count": 5,
"omittedCount": 0,
"dispersion": 2,
"outliers": [
{
"score": 46.5,
"value": 100,
"index": 4
}
]
}Constant series has no robust z outliers
{
"values": [
5,
5,
5
],
"method": "ROBUST_Z"
}{
"truncated": false,
"upperBound": 5,
"method": "ROBUST_Z",
"center": 5,
"lowerBound": 5,
"count": 3,
"omittedCount": 0,
"dispersion": 0,
"outliers": []
}Recommended use cases
- 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
Related skills
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.