mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
9d47ee942d
* feat(Project): use 5 minute data, running training in parallel, sped up cusum filter by 10x with numba * fix(WalkForward): inference mini-batch parallelization * fix(WalkForward): don't use the parallel version of any of the functions * feat(CI): download the data required * fix(Project): 5min_crypto folder added * fix(Evaluate): make sure we have numerical stability in returns * feat(Models): use SKLearn models directly to enable composability * feat(Inference): batched inference now working, added forecasting_horizon * fix(Inference): works again * fix(Inference) * chore(Models): remove unused Ensemble model * fix(Labeller): don't just forward shift returns, also take the sum of the data happened until then * Update test.yml
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
import pandas as pd
|
|
from dataclasses import dataclass
|
|
from typing import Optional, Dict
|
|
|
|
PredictionsSeries = pd.Series
|
|
WeightsSeries = pd.Series
|
|
ProbabilitiesDataFrame = pd.DataFrame
|
|
Stats = Dict[str, float]
|
|
|
|
ModelOverTime = pd.Series
|
|
TransformationsOverTime = list[pd.Series]
|
|
|
|
|
|
@dataclass
|
|
class TrainingOutcome:
|
|
model_id: str
|
|
predictions: PredictionsSeries
|
|
probabilities: ProbabilitiesDataFrame
|
|
stats: Optional[Stats]
|
|
model_over_time: ModelOverTime
|
|
|
|
@dataclass
|
|
class BetSizingWithMetaOutcome:
|
|
model_id: str
|
|
meta_training: TrainingOutcome
|
|
meta_transformations: TransformationsOverTime
|
|
weights: WeightsSeries
|
|
stats: Optional[Stats]
|
|
|
|
@dataclass
|
|
class DirectionalTrainingOutcome:
|
|
training: TrainingOutcome
|
|
transformations: TransformationsOverTime
|
|
|
|
@dataclass
|
|
class PipelineOutcome:
|
|
directional_training: DirectionalTrainingOutcome
|
|
bet_sizing: BetSizingWithMetaOutcome
|
|
|
|
def get_output_weights(self) -> WeightsSeries:
|
|
return self.bet_sizing.weights
|
|
|
|
def get_output_stats(self) -> Stats:
|
|
return self.bet_sizing.stats |