mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-28 11:17:47 +00:00
8dd2d88740
* chore(Linter): reformatted code with black * Create black.yaml
29 lines
741 B
Python
29 lines
741 B
Python
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
|