mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-17 04:48:09 +00:00
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:
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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'
|
||||
|
||||
@@ -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
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user