Feature Engineering: The First Step Toward Predictability
Isolating volatility and skewness to make markets easier to model.
In the previous article, we saw how entropy helps us measure the predictability of a time series. The takeaway was simple: raw returns behave almost like white noise, making them extremely hard to exploit directly.
This is where feature engineering comes in. By transforming raw returns into new variables, such as volatility, skewness, or other statistical descriptors, we can isolate specific characteristics of the series.
These derived features often carry lower entropy, meaning they contain more structure and are easier to model.
2. What is Feature & Target Engineering ?
Feature engineering is the process of creating new variables from raw data to highlight hidden structures. Instead of working only with noisy returns, we design features that describe different aspects of market behavior, volatility, skewness, momentum, correlations, and more.
In trading, this step is crucial: the better your features capture meaningful patterns, the higher your chances of building a predictive model.
Target engineering is the complementary process of defining what we want to predict. For example, instead of using raw returns as a target, we may design labels that reflect price direction, volatility regimes, or risk-adjusted outcomes.
The Quantreo library provides ready-to-use functions for both. Whether you need volatility estimates, distributional statistics like skewness, or measures of complexity such as entropy, you can compute them in just a few lines of code.
3. Example: Returns vs. Volatility vs. Skewness
Let’s see feature engineering in practice. Instead of working only with raw returns, we can compute additional features such as volatility and skewness. Each captures a different property of the return distribution:
Returns → raw price changes.
Volatility → the magnitude of price fluctuations.
Skewness → the asymmetry of returns (how extreme positive vs. negative moves behave).
With Quantreo, this is just a few lines of code:
# Compute the Features
df["returns"] = df["close"].pct_change(1)
df["vol"] = fe.volatility.parkinson_volatility(df=df, window_size=30)
df["skew"] = fe.math.skewness(df=df, col="returns", window_size=30)
# Compute the Entropy
df["entropy_returns"] = fe.math.sample_entropy(df=df, col="returns", window_size=200)
df["entropy_vol"] = fe.math.sample_entropy(df=df, col="vol", window_size=200)
df["entropy_skew"] = fe.math.sample_entropy(df=df, col="skew", window_size=200)
The chart below shows the entropy of these three series:
Returns → high entropy, close to white noise.
Volatility → lower entropy, reflecting persistence and clustering.
Skewness → also lower entropy, capturing asymmetry patterns not visible in raw returns.
4. Why It Matters for Alpha Generation
Alpha rarely comes from raw returns alone. Markets are too noisy for simple signals to consistently work. Instead, alpha is found by uncovering structured features that capture aspects of market behavior not visible at first glance.
Entropy provides a useful lens here:
High-entropy features (like raw returns) → nearly impossible to model.
Lower-entropy features (like volatility or skewness) → more structured, more predictable, and therefore more likely to contribute to a trading edge.
The goal of feature engineering is not to find a single “magic feature,” but to generate many candidates. By testing and filtering them, using tools like entropy, you maximize your chances of identifying information-rich signals that can be combined into a robust strategy.
5. Practical Takeaway
Raw returns are close to noise → hard to model.
Feature engineering (e.g., volatility, skewness) isolates more structured aspects of the data.
Lower entropy = higher predictability → better candidates for modeling.
The process is iterative: generate many features, measure their entropy, and keep those that show exploitable structure.
👉 If you want to go deeper, build smarter features, understand signal reliability, and master techniques like features selection, features engineering, or feature conditioning, that’s exactly what we cover in ML4Trading.
🚀 Whether you're coding your first models or scaling a live strategy, ML4Trading gives you the tools, templates, and theory to design robust and intelligent trading systems.