PostHog · Schema
KNNDetectorConfig
A/B TestingAnalyticsFeature FlagsOpen SourceProduct AnalyticsSession Recording
Properties
| Name | Type | Description |
|---|---|---|
| method | object | Distance method: 'largest', 'mean', 'median' (default: 'largest') |
| n_neighbors | integer | Number of neighbors to consider (default: 5) |
| preprocessing | object | Preprocessing transforms applied before detection |
| threshold | number | Anomaly probability threshold (default: 0.9) |
| type | string | |
| window | integer | Rolling window size — how many historical data points to train on (default: based on calculation interval) |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/KNNDetectorConfig",
"title": "KNNDetectorConfig",
"additionalProperties": false,
"properties": {
"method": {
"default": null,
"description": "Distance method: 'largest', 'mean', 'median' (default: 'largest')",
"allOf": [
{
"$ref": "#/components/schemas/Method"
}
],
"nullable": true
},
"n_neighbors": {
"default": null,
"description": "Number of neighbors to consider (default: 5)",
"title": "N Neighbors",
"type": "integer",
"nullable": true
},
"preprocessing": {
"default": null,
"description": "Preprocessing transforms applied before detection",
"allOf": [
{
"$ref": "#/components/schemas/PreprocessingConfig"
}
],
"nullable": true
},
"threshold": {
"default": null,
"description": "Anomaly probability threshold (default: 0.9)",
"title": "Threshold",
"type": "number",
"nullable": true
},
"type": {
"default": "knn",
"title": "Type",
"type": "string",
"enum": [
"knn"
]
},
"window": {
"default": null,
"description": "Rolling window size \u2014 how many historical data points to train on (default: based on calculation interval)",
"title": "Window",
"type": "integer",
"nullable": true
}
},
"type": "object"
}