FinancialPreprocessor<T>
Models & Types · AiDotNet.Finance.Data
Preprocesses financial time series data into model-ready tensors.
For Beginners
This class is the “data prep” step. It turns messy price bars into clean numeric tensors that models can learn from. It also supports windowing (lookback) and scaling (normalization).
How It Works
FinancialPreprocessor converts raw OHLCV data into feature tensors, builds rolling windows for supervised learning, and provides basic normalization utilities for time series.
Constructors
| Constructor | Summary |
|---|---|
FinancialPreprocessor(INumericOperations<T> numOps) |
Creates a new financial preprocessor. |
Methods
| Method | Summary |
|---|---|
Tensor<T> CreateFeatureTensor(IReadOnlyList<MarketDataPoint<T>> points, bool includeVolume, bool includeReturns) |
Converts raw market data into a 2D feature tensor. |
Tensor<T> NormalizeMinMax(Tensor<T> input, ValueTuple<Vector<T>, Vector<T>> stats) |
Applies min-max normalization across the feature dimension. |
Tensor<T> NormalizeZScore(Tensor<T> input, ValueTuple<Vector<T>, Vector<T>> stats) |
Applies z-score normalization across the feature dimension. |
ValueTuple<Tensor<T>, Tensor<T>> CreateSupervisedLearningTensors(IReadOnlyList<MarketDataPoint<T>> points, int sequenceLength, int predictionHorizon, bool includeVolume, bool includeReturns, bool predictReturns) |
Creates windowed features and targets for supervised forecasting. |
int GetFeatureCount(bool includeVolume, bool includeReturns) |
Gets the number of features produced for each time step. |