Files
drift/models/base.py
T
Mark Aron Szulyovszky 6b26643ece feat(Transformations): replaced feature selection pre-processing step with online version (with cache) (#170)
* feat(Transformations): removed feature-selection pre-processing step completely

* fix(Core): removed unnecessary `original_X`

* fix(Transformations): use the X_expanding_window to transform subsequent data

* fix(RFE): should check for model correctly

* fix(Config): only re-train the model every 40 timestamp

* fix(MetaLabeling): pass in the correct X to meta-labeling step

* fix(Transformation): PCA should at least keep as many features as sliding_window_size

* feat(Transformations): cache transformations across the same asset

* fix(Tests): missing preloaded_transformations arg

* chore(Config): got rid of unnecessary 'classification_models' and 'regression_models' dictionary keys
2022-01-17 11:43:51 +01:00

39 lines
946 B
Python

from __future__ import annotations
from typing import Literal, Optional, Union
from abc import ABC, abstractmethod
import numpy as np
# import numpy as np
class Model(ABC):
method: Literal["regression", "classification"]
data_transformation: Literal["transformed", "original"]
only_column: Optional[str]
model_type: Literal['ml', 'static']
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) -> tuple[float, np.ndarray]:
raise NotImplementedError
@abstractmethod
def clone(self) -> Model:
raise NotImplementedError
@abstractmethod
def get_name(self) -> str:
raise NotImplementedError
@abstractmethod
def initialize_network(self, input_dim:int, output_dim:int):
pass