---
title: Feature Extractor
slug: litmusedge/feature-extractor
docTags: 
createdAt: 2024-08-06T19:31:29.922Z
---

The Feature Extractor processor calculates statistical features, such as the average, standard deviation, and skewness, from a window of raw values, turning raw signal data into inputs that analytics and machine learning models can use directly.

## Why use Feature Extractor

Use this processor to derive statistical features from a signal instead of calculating windowed statistics like variance or kurtosis yourself, for example, to feed a machine learning model with pre-computed features rather than raw values.

## How it works

Set a **Window Size** and the processor continuously recalculates each enabled statistic over that many seconds of incoming values. Enable only the statistics your downstream model or flow needs. Each one adds a field to the output payload.

If your input tag doesn't publish at a steady rate, use **Timer Interval** to publish a value on a fixed schedule instead of waiting for the next incoming event. If your input already publishes at the interval you expect, enter `0` to disable the timer.

## Parameters

| **Parameter**              | **Details**                                                                                                                                             |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Window Size                | The window, in seconds, over which the processor calculates each enabled statistic.                                                                     |
| Minimum                    | The minimum value in the window.                                                                                                                        |
| Maximum                    | The maximum value in the window.                                                                                                                        |
| Average                    | The mean of the values in the window.                                                                                                                   |
| Standard Deviation         | A measure of how spread out the values in the window are, calculated as `sqrt(Σ(x - average)² / (N-1))`.                                                |
| Variance                   | The squared measure of spread within the window, calculated as `Σ(x - average)² / (N-1)`.                                                               |
| Median                     | The middle value in the window. For an odd number of values, this is the center value. For an even number, it's the average of the two center values.   |
| Kurtosis                   | Measures the "heaviness" of the tails of the value distribution, calculated as `[N(N+1) / (N-1)(N-2)(N-3)] × Σ[(xᵢ - average) / stdDeviation]⁴`.        |
| Skewness                   | Measures the asymmetry of the value distribution, calculated as `[N / (N-1)(N-2)] × Σ[(xᵢ - average) / stdDeviation]³`.                                 |
| Zero Crossing Rate         | The number of times the signal crosses zero, that is, changes from a positive to a negative value or a negative to a positive value, within the window. |
| Root Mean Square           | Calculated as `sqrt(Σx² / N)`.                                                                                                                          |
| Quartiles                  | Divides the window into four equal parts based on the median.                                                                                           |
| Inter Quartile Range       | The difference between the third and first quartiles.                                                                                                   |
| Mean Absolute Deviation    | The mean of the absolute deviations from the average, calculated as `Σ\|x - average\| / N`.                                                             |
| Average Absolute Variation | The average absolute variation of the values in the window from the average.                                                                            |
| Timer Interval             | Sets a timer, in milliseconds, that continuously publishes the output when no event triggers a calculation. Enter `0` to disable the timer.             |
| Pass Through Value         | Determines whether the processor's output is the calculated features or the original unchanged input value.                                             |

## Related topics

- [Use the Feature Extractor Function](docId\:hY2El1IjHtIcbiajI2a7x)

