Skip to content

Feature

A feature is a model input. See how a known trailing return differs from its future target, and why timing, transformations and price conventions matter.

A feature is an attribute or constructed representation supplied as an input to a statistical or machine-learning model. In quantitative finance, a trailing return, a bid–ask spread, a reported earnings ratio or an encoded industry category can be a feature. Calling a variable a feature says what role it plays in the model; it does not establish that it predicts returns or earns money.
For a forecasting model, the distinction is operational: the feature must be available when the forecast is made. The outcome being predicted is the target. A historical table can store both beside each other, but their shared row date does not make their values knowable at the same time.

A return can be an input without being a forecast

Suppose a synthetic stock's prior close was USD 100 per share and its current close is USD 110. Both prices have been received and processed before the decision. Assume no distributions, splits or other corporate actions between these closes; use the same currency and share basis at both endpoints.

The trailing simple price-return feature is

xt=PtPt−1−1=110100−1=0.10=10%.x_t=\frac{P_t}{P_{t-1}}-1=\frac{110}{100}-1=0.10=10\%.
Here tt names the current closing observation, while the actual decision occurs after that close becomes usable. The feature looks backward from the forecast decision. It is lagged relative to the outcome being forecast; it is not permission to trade at the already observed closing price.

An example target is the next session's open-to-close simple price return:

yt+1=Ct+1Ot+1−1.y_{t+1}=\frac{C_{t+1}}{O_{t+1}}-1.

Both the next open and the next close occur after this decision. Their realised values are unknown then. The model may use the known 10% trailing return to forecast that future outcome. A positive input does not determine the forecast's sign, and neither input nor forecast guarantees a positive realised target.

Known prior close USD 100 and current close USD 110 give a 10% trailing price-return feature. The decision follows receipt and processing of the current close. Next open and next close are future events with unknown values.
Known prior close USD 100 and current close USD 110 give a 10% trailing price-return feature. The decision follows receipt and processing of the current close. Next open and next close are future events with unknown values.
Original synthetic USD share-price example. The feature uses known closes; the next-session open-to-close target lies entirely after the decision. Timeline spacing is schematic; no trade fill is assumed.
This target describes a price change. It becomes a strategy return only after a separate trading rule specifies feasible entry and exit, position size, distributions, financing and transaction costs. If cash is distributed during a holding interval, a price-return ratio alone omits that cash. When using an adjusted price series, check its documented adjustment and reinvestment conventions before calling the result a total return. The input definition and target definition each need their own economic basis.

Measured, engineered and fitted

These are useful distinctions within a feature pipeline, rather than mutually exclusive kinds of data:

StageExampleWhat must be specified
Measured attributeA received closing price or reported sector classificationSource, units, identity, version and usable time
Engineered featureA trailing price return calculated from eligible closesFormula, lookback, missing-data rule and price-adjustment basis
Fitted transformationA return centred and scaled using estimated training statisticsFitting sample, stored transformation state and update schedule
A measured attribute can enter a model directly, and an engineered value can subsequently be transformed. Feature engineering changes the representation. Feature selection decides which inputs to retain. Neither operation, by itself, proves that the remaining information is useful.

A fixed trailing-return formula needs eligible observations but no fitted mean. Standardising that return using an estimated mean and scale adds learned state. Fit that state on the permitted training data and reuse it for the next evaluation or prediction block; estimating it from future test data introduces data leakage. In a time-ordered financial study, the training information must also have been available by its cutoff, including completed training targets. Merely placing a transformation inside a software pipeline does not choose a valid chronological split.

Define the row before choosing the columns

In a conventional tabular dataset, a row is a sample and a column is a feature. The sample might be an instrument at a decision instant, an order awaiting a fill, or a company at a filing release. Choose that unit first. “Volatility” is an incomplete feature name: whose volatility, over which past observations, using which estimator and annualisation convention, available when?

Useful feature documentation records the instrument identifier, measurement units, source vintage, usable timestamp, transformation and missingness policy. A missing earnings value is not automatically zero earnings. A revised filing is not the figure a trader saw before the revision. These choices can alter the economic meaning of the input even if its column name stays unchanged.

The Point-in-Time Data lesson develops version selection and transformation audits. A public preview is available; the full lesson requires membership.
Finally, treat predictor as a conventional synonym for model input, not a certificate of predictive skill. Likewise, the traditional name “independent variable” does not imply statistical independence from the other features. Assess an input through a defensible out-of-sample experiment, then assess the resulting trading policy under its actual costs and constraints. An available, well-defined feature is a valid candidate for research—not yet an investment signal.

Sources

  • Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani and Jonathan Taylor, An Introduction to Statistical Learning, with Applications in Python (Springer, 2023), §2.1, pp.15–17. Input features and response variables; the authors' website identifies the Python edition and provides the book.
  • scikit-learn: Glossary—feature, checked 27 October 2026. Feature functions, feature values and their representation as columns.
  • scikit-learn: Preprocessing data, checked 27 October 2026. Fitted centring and scaling and subsequent application.
  • scikit-learn: Common pitfalls—data leakage, checked 27 October 2026. Training boundaries for preprocessing and feature selection.
Last updated
  • machine learning
  • model inputs
  • financial data
  • feature engineering
  • data leakage
← Back to the glossaryBack to top ↑