Preprocessing: private API
Types
PortfolioOptimisers.AbstractPreprocessingEstimator — Type
abstract type AbstractPreprocessingEstimator <: AbstractEstimatorAbstract supertype for all preprocessing estimator types.
Preprocessing estimators transform price or returns data (prices-to-returns conversion, missing-data filtering, a gap fill) under a fit/apply contract. Fitting one on training data with fit_preprocessing produces a result carrying any fitted state — a fill's seed, thresholds, and the selected asset universe — which apply_preprocessing then replays on unseen data so train and test windows are transformed consistently. Stateless preprocessing estimators carry no state, and applying them is equivalent to running them.
They are ordinary estimators: they know nothing about pipelines. A Pipeline drives them through the same fit/apply verbs any other caller would use.
All concrete preprocessing estimators should subtype one of the two data-level subtypes:
AbstractPricesPreprocessingEstimator: consumes and produces price-level data (PricesResult).AbstractReturnsPreprocessingEstimator: consumes and produces returns-level data (ReturnsResult).
Related
PortfolioOptimisers.AbstractPricesPreprocessingEstimator — Type
abstract type AbstractPricesPreprocessingEstimator <: AbstractPreprocessingEstimatorAbstract supertype for preprocessing estimators that consume and produce price-level data.
Concrete subtypes transform a PricesResult into another PricesResult.
Related
PortfolioOptimisers.AbstractReturnsPreprocessingEstimator — Type
abstract type AbstractReturnsPreprocessingEstimator <: AbstractPreprocessingEstimatorAbstract supertype for preprocessing estimators that consume and produce returns-level data.
Concrete subtypes transform a ReturnsResult into another ReturnsResult.
Related
PortfolioOptimisers.AbstractPreprocessingResult — Type
abstract type AbstractPreprocessingResult <: AbstractResultAbstract supertype for all preprocessing result types.
Preprocessing results are produced by fit_preprocessing on training data. They carry the fitted state needed to apply the same transformation to unseen data — a fill's seed, thresholds, and the selected asset universe. Stateless preprocessing estimators produce results that carry only their configuration.
All concrete preprocessing results should subtype one of the two data-level subtypes, AbstractPricesPreprocessingResult or AbstractReturnsPreprocessingResult, so a caller can replay each fitted transformation at the data level it applies to.
Related
PortfolioOptimisers.AbstractPricesPreprocessingResult — Type
abstract type AbstractPricesPreprocessingResult <: AbstractPreprocessingResultAbstract supertype for preprocessing results that apply to price-level data (PricesResult).
Related
PortfolioOptimisers.AbstractReturnsPreprocessingResult — Type
abstract type AbstractReturnsPreprocessingResult <: AbstractPreprocessingResultAbstract supertype for preprocessing results that apply to returns-level data (ReturnsResult).
Related
Functions
PortfolioOptimisers.is_missing_value — Function
is_missing_value(x) -> Bool
Return true when x counts as a missing observation in price-level data.
Price-level data stores absent observations either as missing or as NaN, the two conventions unify_gaps spells as one at the ingestion door; this reads both because it stands at that door, on a carrier built by hand.
Algorithm
- Return
truewhenxismissing. - Return
truewhenxis aNumberandisnan(x)holds. The type test guards the call, becauseisnanis not defined for every value a price table can carry. - Return
falseotherwise.
Arguments
x: The value to test.
Returns
flag::Bool:truewhenxismissingor aNaNnumber.
Related