Skip to content
All library documents

Building and Aligning Forward-Return Labels for Stock Models

Article BigQuant

Summary

The document discusses constructing supervised-learning targets from daily Chinese stock data. Its SQL example derives a forward return from later prices, clips extreme values using the first and ninety-ninth percentiles, and selects dates, instruments, and a label for model training. It also filters out missing fields and cases where the following day’s high and low are equal, which the author associates with price-limit trading.

The central problem is a neural-network input-shape error: the model expects 17 features but receives 18. This points to a mismatch between the columns supplied as model inputs and the intended target and identifier columns. The text does not provide a confirmed fix, and its comments and SQL are inconsistent about the forecast horizon and whether the label is a continuous clipped return or a discretized bucket. Those ambiguities limit its value as a ready-to-use recipe; its strongest lesson is to keep feature columns separate from labels and verify that training data matches the model’s input dimensions.

Key ideas

  • The example creates a forward-return target from daily stock prices for supervised model training.
  • It clips extreme target values using lower and upper quantiles before model fitting.
  • The reported training failure arises because the supplied input has one more column than the model expects.
  • Target, date, and instrument columns should be checked against the model’s feature inputs.
  • The description contains conflicting details about the return horizon and target encoding.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.