The deck opens by stating the problem without softening it: raw data could be unsuitable for forecasting algorithms. Two reasons are given, and they are different in kind.
So data preprocessing has the objective of making raw data better compatible with the selected algorithm. Note the direction of the arrow: preprocessing is chosen for a model, not in the abstract. And then the warning that should be printed on the inside of every student's eyelids: there are many different preprocessing options, and no deterministic rule on what to do.
What preprocessing is aiming at is stated in one line under a picture of white noise: that is the easiest time series to forecast, and data preprocessing tries to revert to this case. It sounds paradoxical — flat noise is unforecastable — but it is exactly right. Every structure you can strip out and model explicitly (trend, seasonality, changing variance) is structure the fitting algorithm no longer has to discover for itself. What should be left over is the part nobody can predict.
Preprocessing is not cleaning. It is moving structure out of the residual and into the model specification, where it can be inverted afterwards. Every transform in this chapter is paired with its inverse, because the forecast must eventually be returned to the original scale.
A moment is a specific quantitative measure of the shape of a function. The statistical description of a time series rests on three of them.
| Moment | Definition | What it measures |
|---|---|---|
| Mean | μt = E[yt] | The level of the series at time t. |
| Variance | σ²t = E[(yt - μt)²] | The spread around that level. |
| Autocovariance | γt,s = E[(yt - μt)(ys - μs)] | Relates the value at time t with the value at time s. It is what the autocorrelograms of chapter 2 represent. |
These three quantities are the vocabulary in which stationarity is about to be defined, and the reason the definition has exactly three clauses.
A time series is stationary if:
Or, compressed into the sentence worth memorising: a series is stationary if its distribution is invariant with respect to translations in time. Slide the window anywhere along the series and it looks statistically the same.
The slides give two contrasting examples. Daily total female births in California, 1959 is a stationary process: no trends, stationary in mean and variance, no seasonality or cyclicity. Accidental deaths in the U.S.A. (1973-1978) is stationary in mean and variance but with seasonality — a reminder that the three conditions fail independently, and that a series can be well behaved in two of them and useless in the third.
We try to make a series stationary in mean by differencing: subtracting from the current value the value of the previous time moment.
first order: ∇yₜ = yₜ - yₜ₋₁
second order: ∇²yₜ = ∇yₜ - ∇yₜ₋₁ = yₜ - 2yₜ₋₁ + yₜ₋₂
seasonal (L): ∇ₜyₜ = yₜ - yₜ₋₄
If the series has a linear trend, the resulting differenced series is stationary in means. More generally, the difference transform subtracts from each entry the entry back-shifted by a constant time lag: a simple way for removing a systematic structure from the series. The process can be repeated — difference the differenced series — to remove second-order trends. A seasonal structure is removed by subtracting the observation from the prior season: e.g. 12 time steps before, for monthly data with a yearly seasonal structure.
Applying a first difference to the TV sales series gives, for t = 2 … 20:
| t | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|
| diff | 53 | -94 | 132 | 188 | -181 | -12 | 169 | 122 | -118 | -109 |
| t | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | |
| diff | 245 | 49 | -218 | 50 | 269 | 79 | -284 | -49 | 306 |
The slides annotate this table with two words: removed the linear trend! The differenced series oscillates around a roughly constant level instead of climbing. What it has not removed is the seasonal alternation, still visible as the regular sign pattern, nor the growth of the swing amplitude.
The invertibility is the point. difference() throws away the first interval observations and produces increments; invert_difference() replays them from the original head. Every forecast produced on differenced data must go back through this function before anyone sees it.
Where differencing fixes the mean, the log transform attacks the variance — and, combined with diff, both.
The slides derive the key approximation carefully. The function y = ln(x) is tangent at (1, 0) to the line y = x - 1, so ln(1+r) ≈ r when r is small with respect to 1 (say r ≤ 0.2). Now suppose x has a small percent increase, for example 5%: it changes from x to (1+r)x with r = 0.05. Then
ln((1+r)x) = ln(x) + ln(1+r) ≈ ln(x) + r
If x increases by 5%, the log of x increases from ln(x) to ln(x) + 0.05. Since a percent variation of a series is (yt - yt-1) / yt-1, the conclusion is that a percent variation is almost equal to ln(yt) - ln(yt-1) — the log-difference is the growth rate.
The slides check it numerically on the first airline passenger records:
| Passengers | % var (r) | ln(x) | ln(x₋₁) + r |
|---|---|---|---|
| 112 | 4.718499 | ||
| 118 | 0.053571 | 4.770685 | 4.772070 |
| 132 | 0.118644 | 4.882802 | 4.889329 |
| 129 | -0.02273 | 4.859812 | 4.860075 |
| 121 | -0.06202 | 4.795791 | 4.797797 |
| 135 | 0.115702 | 4.905275 | 4.911493 |
The last two columns agree to three decimals, and disagree slightly more when r is largest — exactly as the approximation predicts.
| Property | Consequence |
|---|---|
| Linearization of exponential increases: ln(xy) = ln(x) + ln(y) | The log transform turns multiplicative relations into additive ones and exponential trends into linear ones. It makes it possible to use linear models for exponential processes. |
| Trends in log units ≈ percentage increases | The slope of a trend on a log scale equals the percentage increase of the original series. |
| Errors in log units ≈ percentage errors | Errors measured on log data can be read as percentage errors on the original data. |
Taking logs first and then differencing gives the pair of columns the slides annotate as removed the trend on variance! and removed the trend on means and variance!
| t | yt | log | log-diff |
|---|---|---|---|
| 1 | 128 | 4.85 | |
| 2 | 181 | 5.20 | 0.35 |
| 3 | 87 | 4.47 | -0.73 |
| 4 | 219 | 5.39 | 0.92 |
| 5 | 407 | 6.01 | 0.62 |
| … | … | … | … |
| 19 | 419 | 6.04 | -0.11 |
| 20 | 725 | 6.59 | 0.55 |
Each button applies one rung of the ladder to the twenty TV-sales points. The verdict box compares the mean and the standard deviation of the first half against the second half: that comparison is the working definition of stationarity in mean and in variance.
Know which transform repairs which condition. Diff → stationarity in mean, by removing a linear trend (repeat for higher-order trends, use lag L for seasonality). Log → stationarity in variance, by turning proportional growth into constant growth. Log then diff → both, and it is the standard opening move on the Box-Jenkins airline series in chapter 4.
The log is one member of a family. A power transform is a family of functions that create a monotonic transformation of data using power functions, used to stabilise variance and make the data more normal-distribution-like. On a time series, this can remove a change in variance over time. Popular examples: the log transform, the square root transform, and the generalised Box-Cox transform, which transforms positive data according to
⌈ (xᵥ - 1) / λ if λ ≠ 0
BC(x) = ⌊ ln(x) if λ = 0
and where the λ value is chosen to maximise the log-likelihood function, making the data as normally distributed as possible. So Box-Cox with λ = 0 is the log transform; λ = 0.5 is essentially a square root; λ = 1 leaves the shape alone. Choosing λ automatically is what makes it attractive: you do not have to guess how strong the variance stabilisation should be.
from math import log, exp
from scipy.stats import boxcox
import pandas as pd
def invert_boxcox(value, lam):
if lam == 0: # log case
return exp(value)
return exp(log(lam * value + 1) / lam) # general case
data = pd.read_csv('FilRouge.csv', usecols=[1]).values.flatten()
transformed, lmbda = boxcox(data)
print(f"data={transformed}, lmbda={lmbda}")
inverted = [invert_boxcox(x, lmbda) for x in transformed]
Note the shape of that snippet: transform, use, invert. It is the same three-beat rhythm as the difference transform, and it is the rhythm the exam project has to implement for whatever preprocessing it chooses.
Two rescalings that are constantly confused, so the slides define them separately.
A transform for data with a Gaussian distribution, resulting in a standard normal. It rescales the distribution so that the mean of observed values is 0 and the standard deviation is 1. It subtracts the series mean x̄ and divides by the sample standard deviation s:
xₛ = (xᵢ - x̄) / s
from sklearn.preprocessing import StandardScaler
data = pd.read_csv('FilRouge.csv', usecols=[1]).values # column vector!
transformer = StandardScaler()
transformer.fit(data)
transformed = transformer.transform(data) # mean 0, std 1
inverted = transformer.inverse_transform(transformed)
In the simplest case, a rescaling of data from the original range to a new range (min-max feature scaling), usually between 0 and 1:
xₙ = (xᵢ - xᵐᵢₙ) / (xᵐₐₓ - xᵐᵢₙ)
In more complicated cases, normalization may refer to adjustments where the intention is to bring the entire probability distribution of adjusted values into a given alignment.
from sklearn.preprocessing import MinMaxScaler
data = pd.read_csv('FilRouge.csv', usecols=[1]).values
transformer = MinMaxScaler()
transformer.fit(data.T)
transformed = transformer.transform(data) # min 0, max 1
inverted = transformer.inverse_transform(transformed)
Standardization assumes a roughly Gaussian shape and is indifferent to outliers only in the sense that it does not clip them; normalization pins the range, which is what activation functions want. Chapter 5 makes the requirement explicit: because sigmoid activations are defined on ]-1, 1[ (hyperbolic tangent) or ]0, 1[ (logistic), input data must be scaled, and some authors recommend scaling into a narrower interval such as [0.2, 0.8] to avoid saturation at the asymptotes.
Both are invertible, and both must be fitted on training data only. Chapter 7 shows what happens when a min-max scaler is fitted on data the model will later be tested against.
The slides refuse to be encouraging here, and they are right to: there is NO good way to deal with missing data, and imputation does not necessarily give better results. Imputation algorithms divide into simple but fast approaches, like mean imputation, and more advanced algorithms that need more computation time, like Kalman smoothing.
| Family | Methods | When it is defensible |
|---|---|---|
| Non-time-series specific | mean imputation, median imputation, mode imputation — calculate the appropriate measure and replace NAs with it; random sample imputation, replacing missing values with observations randomly selected from the remaining data. | Replacing with a central measure is appropriate for stationary time series. Random sample imputation is not likely to work well unless the random selection is carefully chosen. |
| Time-series specific | LOCF (last observation carried forward), NOCB (next observation carried backward), linear interpolation, spline interpolation. | These rely on the assumption that adjacent observations are similar to one another. They do not work well when that assumption fails — for instance in the presence of strong seasonality, where the nearest useful neighbour is one period away, not one step away. |
ds = pd.Series(y)
ds1 = ds.ffill() # LOCF
ds2 = ds.bfill() # NOCB
ds3 = ds.fillna(ds.mean()) # mean imputation
ds4 = ds.interpolate() # linear interpolation
From here the deck marks its own content as advanced topics: sketches of subjects that deserve much more grounding, offered as pointers to issues that could need to be addressed in order to enhance forecasting effectiveness. These are also the "advanced extensions" that lift an exam project into the top band.
An outlier is an observation that significantly differs from other observations of the same feature. Time series with outliers have three characteristics: there is a systematic pattern (deterministic) and some variation (stochastic); only a few data points are outliers; and outliers are significantly different from the rest of the data.
An anomaly detection algorithm must either label each time point as anomaly / not anomaly, or forecast a signal for some point and test whether the actual value deviates from the forecast enough to be deemed an anomaly. Two decomposition-based approaches are given:
from statsmodels.tsa.seasonal import seasonal_decompose
df = pd.read_csv("traffico16.csv")
col = "ago2"
series = df[col].fillna(value=df[col].mean())
result = seasonal_decompose(series, model='additive', period=7)
Resid = result.resid
std = Resid.std()
plt.plot(Resid, "o", label="datapoints")
plt.hlines(0, 0, len(Resid))
plt.hlines( 1.5*std, 0, len(Resid), color="red", label="std limits")
plt.hlines(-1.5*std, 0, len(Resid), color="red")
plt.legend(); plt.show()
The slides attach a caution that is easy to skip and expensive to ignore: in certain applications outliers are data of special interest, not data to be deleted. In predictive maintenance the anomaly is the signal. Deleting outliers is a modelling decision, never a cleaning step.
In multivariate analysis, datasets can be defined over too many dimensions — attributes can number in the hundreds or thousands. Five reasons are given for reducing them: less storage space; less computation and training time; some algorithms do not perform well in large dimensions; it takes care of multicollinearity by removing redundant features; and it helps in visualising data.
It can be done in two different ways: (1) keeping only the most relevant variables from the original dataset — properly called feature selection; (2) finding a smaller set of new variables, each a combination of the input variables, containing basically the same information — sometimes called dimensionality reduction proper.
| Technique | Rule |
|---|---|
| Missing Value Ratio | Attributes with too many missing values (50%?) can be discarded. |
| Low Variance Filter | Attributes often repeating one same value can be discarded. |
| High Correlation Filter | If two variables are highly correlated one can be dropped, keeping the one most correlated with the target. |
| Random Forest | Very popular; feature importance falls out of the ensemble (chapter 6). |
| Backward Feature Elimination | Re-train omitting one feature; if its removal has no big effect, remove it. |
| Forward Feature Selection | Start with few attributes, include the features contributing the greater improvement. |
| PCA | Extracts a new set of variables from a large existing set by linear combinations; the new variables are the principal components. |
| SVD | Singular value decomposition: another mathematical approach decomposing the original dataset into its constituents. |
Data augmentation means generating artificial data in order to reduce the variance of the output (to reduce the number of errors). Widely used in image analysis, but useful also when dealing with too short time series — which, given the fil rouge has twenty points, is a live concern. Common techniques for time series classification: extrapolation (fill relevant fields with values based on heuristics — a trend-seasonality model can compute predicted values for instants not covered by the series); tagging (common records tagged to a group); aggregation (values estimated using averages and means); probability (values populated based on the probability of events).
Bootstrapping is useful both for augmentation and for uncertainty estimation: it generates many pseudo-samples from your observed series to empirically estimate the distribution of a statistic without assuming a parametric model. In forecasting, this translates into confidence intervals derived from data alone.
| Method | Mechanism |
|---|---|
| Block bootstrap | Resamples contiguous blocks of observations, preserving local temporal dependency structure. |
| Stationary bootstrap | Uses random-length blocks for stationarity; block length drawn from a geometric distribution. |
| Residual bootstrap | Fit a model, resample the residuals, reconstruct the series — separating signal from noise. |
Why it matters, in the slides' own list: no distributional assumptions; works with non-linear models; forecast interval estimation; model selection validation; and it handles short series well.
Denoising can be heavily borrowed from signal processing techniques to improve the signal-to-noise ratio (SNR). The general recipe is analysis in the frequency domain: apply a Fourier transform (or a wavelet transform) to the series, and then an appropriate filter.
| Filter | Definition | Time-series instance |
|---|---|---|
| Low pass | Passes signals with a frequency lower than a cut-off and attenuates higher ones. | A simple moving average (SMA) is a low pass filter. |
| High pass | Passes signals with a frequency higher than a cut-off and attenuates lower ones. | Either linear filters such as SMA, or non-linear filters such as a median filter. Consider also the Kalman filter. |
The premise is the classic one: any periodic function (or function defined on an interval) can be reconstructed by adding an appropriate, infinite number of sinusoids with appropriate amplitudes and frequencies. Spectral analysis is a technique to discover periodicities underlying time series, and to that end we first transform data from the time domain to the frequency domain.
The Fourier transform of a function of time is a complex-valued function of frequency, whose magnitude represents the amount of that frequency present in the original function, and the transformation is invertible. For data series, the Discrete Fourier Transform (DFT) converts a finite sequence of equally spaced samples into a same-length sequence of equally spaced samples of a complex-valued function of frequency. The Fast Fourier Transform (FFT) is an algorithm that computes the DFT efficiently, in O(n log n).
Two facts about the output that you must not forget when coding it:
And the sentence that explains why any of this is a preprocessing technique: noise has high frequency; cutting out high frequencies prevents from representing noise. A second, less obvious use is noted too: spectral decomposition can be used as externals — as exogenous variables for SARIMAX — because sinusoids extend into the future; usually a low number of frequencies is used.
The pipeline needs a stationary signal first: detrend the series and keep only the seasonal component, either via seasonal_decompose(...).seasonal or via scipy.signal.detrend(). Only half of the transformed values are used, because of FFT symmetry. And remember that periods (wavelengths) are the inverse of frequencies.
detrended_series = signal.detrend(orig_values, type="linear")
fft = np.fft.fft(detrended_series)
n = len(fft)
one_sided_fft = fft[:int(n/2)+1] # conjugate symmetry: half is enough
Fs = 1 # 1 observation per unit of time
nyquist = Fs/2 # only frequencies up to Fs/2 matter
power = np.abs(one_sided_fft)**2 / n # magnitude squared over length
freq_sample = np.array(range(n)) / n # normalized frequency grid
x_freq = freq_sample[:int(n/2)+1]
frequency_max = freq_sample[np.where(power == np.amax(power))]
print("Max period {}".format(1/frequency_max))
# ---------- low pass filter
f_cut = 1/4 # keep only periods longer than the denominator
mask = np.logical_or(freq_sample <= f_cut, freq_sample >= 1 - f_cut)
fft_lowpass = fft * mask # reconstruction needs the FULL fft array
reconstructed_detrended = np.real(np.fft.ifft(fft_lowpass))
t = np.arange(len(orig_values)) # put the trend back
coeff = np.polyfit(t, orig_values, 1)
trend = coeff[0] * t + coeff[1]
reconstructed_series = reconstructed_detrended + trend
The mask line deserves a second look: it keeps frequencies below the cut-off and above 1 - f_cut, because the second half of the FFT array is the mirror image of the first. Masking only the left half would destroy the symmetry and give a complex reconstruction. A convenience alternative is np.fft.rfft / np.fft.irfft, which keep only half the frequencies for you, or scipy.signal.periodogram, which returns the spectrum directly.
A clean seasonal component plus high-frequency noise. Slide the cut-off down and watch the reconstruction shed the noise — and then, if you go too far, shed the signal as well.
An autoencoder is a simple neural network trained with the same dataset both as input and as output of the network, where the network has fewer hidden neurons than the input/output ones. The bottleneck is the whole trick: the network cannot copy its input through, so it must learn a compressed description. Since noise has much higher dimensions than regular data, this process reduces the noise. The slides note that this is similar to PCA and is a general dimensionality reduction technique.
class Autoencoder(nn.Module):
def __init__(self, input_dim, latent_dim):
super(Autoencoder, self).__init__()
self.encoder = nn.Sequential(
nn.Linear(input_dim, 64), nn.ReLU(),
nn.Linear(64, latent_dim), nn.ReLU()
)
self.decoder = nn.Sequential(
nn.Linear(latent_dim, 64), nn.ReLU(),
nn.Linear(64, input_dim), nn.Sigmoid() # output in [0, 1]
)
def forward(self, x):
latent = self.encoder(x)
return self.decoder(latent)
Three further uses are listed beyond denoising. Anomaly detection: autoencoders reconstruct "normal" patterns well but struggle with anomalies, so the reconstruction errors correspond to outliers, which can be removed or flagged before the forecasting model. Handling missing data: they can be trained to impute gaps, giving a cleaner, complete dataset. Dimensionality reduction and feature extraction: rather than feeding raw, high-dimensional series into a forecasting model, use the encoder output as features — these learned features tend to capture temporal structure (trends, seasonality, correlations) more effectively than hand-crafted ones.
The Kalman filter is an algorithm that provides estimates of some unknown variables given their measurements observed over time. It is called a filter because it filters out noise. The precise statement of its optimality is worth quoting: if all noise is Gaussian, the Kalman filter minimises the mean square error of the estimated parameters; if the noise is NOT Gaussian, the Kalman filter is the best linear estimator, but non-linear estimators may be better.
Its practical appeal is architectural: Kalman filters have a relatively simple form and require small computational power — they do not need to keep any history other than the previous state — and they are very fast, which makes them well suited to real-time problems and embedded systems.
The model assumes the true state at time t evolves from the state at t-1:
xₜ = Fₜ xₜ₋₁ + Bₜ uₜ + wₜ state transition
zₜ = Hₜ xₜ + vₜ observation
| Symbol | Role |
|---|---|
| Ft | the state transition model applied to the state xt-1 |
| Bt | the control-input model applied to the input vector ut |
| wt | the process noise, assumed drawn from a zero-mean multivariate normal distribution |
| Ht | the observation model, mapping the true state space into the observed space |
| vt | the observation noise, assumed zero-mean Gaussian white noise |
The slides add the practical footnote: matrices need to be identified for the specific application. That identification is the real work.
The algorithm consists of two stages, cycled for each new measurement — and the slides note that the terms prediction and update are often called propagation and correction in different literature.
The gain itself has a memorable form:
K = Error in Prediction / (Error in Prediction + Error in Measurement)
Its value ranges from 0 to 1: near 0, the predicted value is close to the actual value; near 1, the measured value is close to the actual value. The cycle continues until the difference between predicted and measured value converges to zero.
Both the prediction and the measurement are unreliable. The gain decides how the two are blended, using nothing but their error magnitudes.
from pykalman import KalmanFilter
measurements = y.to_numpy()
kf = KalmanFilter(transition_matrices=[1],
observation_matrices=[1],
initial_state_mean=measurements[0],
initial_state_covariance=1,
observation_covariance=10,
transition_covariance=10)
state_means, state_covariances = kf.filter(measurements)
The slides report the outcome on their example series as randomness reduced by 50%, and add the sentence that ties this whole chapter back to the rest of the course: once you have the filtered series, you can make forecasts by training the model you have chosen using the "clean" data.
Three denoising routes, three different assumptions. Low-pass / FFT assumes noise lives at high frequency. Autoencoder assumes noise lives in high dimensions that a bottleneck cannot fit. Kalman assumes noise is Gaussian, and is provably MSE-optimal only in that case — otherwise it is merely the best linear estimator. Be able to state which assumption each one makes.
The objective is making raw data better compatible with the selected algorithm, because raw data may be unsuitable — some algorithms require data with specific characteristics, others simply perform better in a given format. There are many different preprocessing options and no deterministic rule on what to do. The target is the easiest series to forecast, white noise: preprocessing tries to revert to that case, so that everything predictable has already been moved into the model.
(1) The mean is constant over time (stationarity in means). (2) The variance is constant over time (stationarity in variance). (3) The relation between values separated by k periods depends only on k, not on time (stationarity in covariance). In one line: a series is stationary if its distribution is invariant with respect to translations in time.
Mean μt = E[yt]; variance σ² = E[(yt - μ)²]; and autocovariance γt,s = E[(yt - μ)(ys - μ)], which relates the value at time t with the value at time s and is what autocorrelograms represent.
First: ∇yt = yt - yt-1, which makes a series with a linear trend stationary in means. Second: ∇²yt = yt - 2yt-1 + yt-2, for second-order trends. Seasonal: yt - yt-L, subtracting the corresponding value of the previous season — e.g. 12 steps back for monthly data with a yearly structure.
Because ln(x) is tangent at (1,0) to y = x - 1, so ln(1+r) ≈ r for small r. If x grows by a fraction r, then ln((1+r)x) = ln(x) + ln(1+r) ≈ ln(x) + r. Since the percent variation of a series is (yt - yt-1)/yt-1, that variation is almost exactly ln(yt) - ln(yt-1).
Linearization of exponential increases — ln(xy) = ln(x) + ln(y), so multiplicative relations become additive and exponential trends become linear, making linear models usable on exponential processes. Trends measured in log units are approximately percentage increases. Errors measured in log units are approximately percentage errors on the original data.
A power transform on positive data: (xᵥ - 1)/λ for λ ≠ 0 and ln(x) for λ = 0. Power transforms are monotonic transformations used to stabilise variance and make data more normal-like, removing a change in variance over time. The λ value is chosen to maximise the log-likelihood function, making the data as normally distributed as possible.
Standardization targets Gaussian data and produces a standard normal: subtract the mean and divide by the standard deviation, giving mean 0 and standard deviation 1 (StandardScaler). Normalization in the simplest case is min-max feature scaling: (x - xmin)/(xmax - xmin), rescaling to a new range, usually 0 to 1 (MinMaxScaler). More generally normalization can mean bringing an entire probability distribution into a given alignment.
LOCF (last observation carried forward), NOCB (next observation carried backward), linear interpolation and spline interpolation. They all rely on the assumption that adjacent observations are similar to one another, and therefore fail when that is untrue — notably in the presence of strong seasonality. The general warning stands: there is no good way to deal with missing data, and imputation does not necessarily give better results.
Split the signal into seasonal, trend and residue; then analyse the deviation of the residue and introduce a threshold on it — points beyond, say, 1.5 standard deviations of the residual are flagged. The same can be done with ARIMA or exponential smoothing, or by training classification and regression trees to label points. The caution: in certain applications outliers are data of special interest, not data to be deleted.
It reduces storage, reduces computation and training time, helps algorithms that perform poorly in high dimensions, takes care of multicollinearity by removing redundant features, and helps visualisation. The two forms: feature selection, keeping only the most relevant original variables (missing value ratio, low variance filter, high correlation filter, backward elimination, forward selection, random forest); and dimensionality reduction proper, finding a smaller set of new variables that are combinations of the inputs (PCA, SVD).
For a real-valued series the transform satisfies FT(k) = FT(n-k), symmetric around n/2, so only half the transform data is needed for analysis — but the full array is needed for reconstruction, which is why a low-pass mask must keep both f ≤ f_cut and f ≥ 1 - f_cut. Nyquist-Shannon says a signal with components up to F must be sampled at a rate of at least 2F to be reconstructed; sampling at F recovers only up to F/2. Since noise has high frequency, cutting high frequencies suppresses noise.
It is trained with the same dataset as input and output, but has fewer hidden neurons than input/output ones. Since noise has much higher dimensions than regular data, the bottleneck cannot represent it and the reconstruction comes back cleaner — similar in spirit to PCA. Beyond denoising: anomaly detection (high reconstruction error flags outliers), missing data imputation, and feature extraction, using the encoder output as features that capture temporal structure better than hand-crafted ones.
K = Error in Prediction / (Error in Prediction + Error in Measurement), with K ∈ [0,1]. Near 0 the predicted value is close to the actual value, so the filter leans on its own prediction; near 1 the measured value is close to the actual value, so it leans on the sensor. The filter is a mean-square-error minimiser when all noise is Gaussian; if the noise is not Gaussian it is only the best linear estimator, and non-linear estimators may beat it.