feat(Transformations): added Transformations abstraction & handling in walk_forward_train() & inference() (#161)

* feat(Transformations): added Transformations abstraction & handling in walk_forward_train() & inference()

* fix(WalkForward): use Dataframes to call Transformation.fit_transform()

* feat(WalkForward): restored option for models to recieve unscaled data

* fix(Transformations): output DataFrame as expected

* fix(Tests): missing new property
This commit is contained in:
Mark Aron Szulyovszky
2022-01-12 23:22:55 +01:00
committed by GitHub
parent 3084f5e271
commit 1856fcad22
16 changed files with 144 additions and 85 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ class StaticAverageModel(Model):
Model that averages .
'''
data_scaling = 'unscaled'
data_transformation = 'original'
only_column = 'model_'
feature_selection = 'off'
model_type = 'static'
+1 -1
View File
@@ -7,7 +7,7 @@ import numpy as np
class Model(ABC):
data_scaling: Literal["scaled", "unscaled"]
data_transformation: Literal["transformed", "original"]
feature_selection: Literal["on", "off"]
# data_format: Literal["wide", "narrow"]
only_column: Optional[str]
+1 -1
View File
@@ -7,7 +7,7 @@ class StaticMomentumModel(Model):
Model that uses only one feature: momentum. It's positive if momentum is greater than 0, otherwise it's negative.
'''
data_scaling = 'unscaled'
data_transformation = 'original'
only_column = 'mom'
feature_selection = 'off'
model_type = 'static'
+1 -1
View File
@@ -7,7 +7,7 @@ class StaticNaiveModel(Model):
Model that carries the last observation (from returns) to the next one, naively.
'''
data_scaling = 'unscaled'
data_transformation = 'original'
only_column = None
feature_selection = 'off'
model_type = 'static'
+1 -1
View File
@@ -7,7 +7,7 @@ import pytorch_lightning as pl
class LightningNeuralNetModel(Model):
data_scaling = 'scaled'
data_transformation = 'transformed'
only_column = None
feature_selection = 'off'
model_type = 'ml'
+1 -1
View File
@@ -6,7 +6,7 @@ from sklearn.base import clone
class SKLearnModel(Model):
data_scaling = 'scaled'
data_transformation = 'transformed'
only_column = None
feature_selection = 'on'
model_type = 'ml'
+1 -1
View File
@@ -8,7 +8,7 @@ from copy import deepcopy
class StatsModel(Model):
# This is work in progress
data_scaling = 'scaled'
data_transformation = 'transformed'
only_column = None
feature_selection = 'on'
model_type = 'ml'
+1 -1
View File
@@ -6,7 +6,7 @@ from sklearn.base import clone
class XGBoostModel(Model):
data_scaling = 'scaled'
data_transformation = 'transformed'
only_column = None
feature_selection = 'on'
model_type = 'ml'