mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-16 04:18:07 +00:00
refactor(WalkForward): separate train / test functions to help with inference later (#158)
* refactor(WalkForward): separate train / test functions (draft) to potentially help with inference later * fix(Training): use the new separate train / test functions * feat(Training): return and pass in scalers that are necessary for inference * fix(Project): runtime errors * fix(WalkForward): use the correct `train_from` value * fix(Tests): for new walk_forward functions() * refactor(WalkForward): rename `walk_forward_test()` to `walk_forward_inference()`
This commit is contained in:
+3
-3
@@ -1,8 +1,8 @@
|
||||
from sklearn.preprocessing import MinMaxScaler, Normalizer, StandardScaler
|
||||
from typing import Optional, Union
|
||||
from typing import Union
|
||||
from utils.types import ScalerTypes
|
||||
|
||||
def get_scaler(type: ScalerTypes) -> Optional[Union[MinMaxScaler, Normalizer, StandardScaler]]:
|
||||
def get_scaler(type: ScalerTypes) -> Union[MinMaxScaler, Normalizer, StandardScaler]:
|
||||
if type == 'normalize':
|
||||
return Normalizer()
|
||||
elif type == 'minmax':
|
||||
@@ -10,4 +10,4 @@ def get_scaler(type: ScalerTypes) -> Optional[Union[MinMaxScaler, Normalizer, St
|
||||
elif type == 'standardize':
|
||||
return StandardScaler()
|
||||
else:
|
||||
return None
|
||||
raise Exception("Scaler type not supported")
|
||||
Reference in New Issue
Block a user