mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-15 20:08:08 +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:
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
from typing import Literal, Optional, Union
|
||||
from abc import ABC, abstractmethod
|
||||
import pandas as pd
|
||||
|
||||
class Transformation(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def fit(self, X: pd.DataFrame, y: Optional[pd.Series]) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def fit_transform(self, X: pd.DataFrame, y: Optional[pd.Series] = None) -> pd.DataFrame:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def transform(self, X: pd.DataFrame) -> pd.DataFrame:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def clone(self) -> Transformation:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
def get_name(self) -> str:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user