mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-28 11:17:47 +00:00
9d47ee942d
* feat(Project): use 5 minute data, running training in parallel, sped up cusum filter by 10x with numba * fix(WalkForward): inference mini-batch parallelization * fix(WalkForward): don't use the parallel version of any of the functions * feat(CI): download the data required * fix(Project): 5min_crypto folder added * fix(Evaluate): make sure we have numerical stability in returns * feat(Models): use SKLearn models directly to enable composability * feat(Inference): batched inference now working, added forecasting_horizon * fix(Inference): works again * fix(Inference) * chore(Models): remove unused Ensemble model * fix(Labeller): don't just forward shift returns, also take the sum of the data happened until then * Update test.yml
25 lines
665 B
Python
25 lines
665 B
Python
from __future__ import annotations
|
|
from typing import Literal, Optional, Union
|
|
from abc import ABC, abstractmethod
|
|
import numpy as np
|
|
|
|
class Model(ABC):
|
|
|
|
name: str = ""
|
|
data_transformation: Literal["transformed", "original"]
|
|
only_column: Optional[str]
|
|
predict_window_size: Literal['single_timestamp', 'window_size']
|
|
|
|
@abstractmethod
|
|
def fit(self, X: np.ndarray, y: np.ndarray) -> None:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def predict(self, X: np.ndarray) -> np.ndarray:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def predict_proba(self, X: np.ndarray) -> np.ndarray:
|
|
raise NotImplementedError
|
|
|