Files
drift/models/sklearn.py
T
Mark Aron Szulyovszky 9d47ee942d feat(Project): use SKLearn models directly, removed custom ensembling, use 5 minute data, batch inference, numba cusum filter (#192)
* 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
2022-02-17 16:36:35 +01:00

23 lines
562 B
Python

from __future__ import annotations
from typing import Literal
from .base import Model
import numpy as np
def SKLearnModel(instance) -> Model:
instance.data_transformation = 'transformed'
instance.only_column = None
instance.predict_window_size = 'single_timestamp'
instance.name = instance.__class__.__name__
return instance
# def predict(self, X) -> tuple[float, np.ndarray]:
# pred = self.model.predict(X).item()
# probability = self.model.predict_proba(X).squeeze()
# return (pred, probability)