mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-08 00:27:50 +00:00
feat(Models): added lightGBM, moved other models to separate files (#128)
* feat(Models): added lightGBM, moved other models to separate files * feat(Models): added non-working statsmodel wrapper * fix(Models): added work-in-progress comment to StatsModels
This commit is contained in:
committed by
GitHub
parent
6982187872
commit
fc5eba4e2d
@@ -0,0 +1,35 @@
|
||||
from __future__ import annotations
|
||||
from statsmodels.tsa.base.tsa_model import TimeSeriesModel
|
||||
from models.base import Model
|
||||
import numpy as np
|
||||
from copy import deepcopy
|
||||
|
||||
|
||||
class StatsModel(Model):
|
||||
|
||||
# This is work in progress
|
||||
data_scaling = 'scaled'
|
||||
only_column = None
|
||||
feature_selection = 'on'
|
||||
model_type = 'ml'
|
||||
predict_window_size = 'single_timestamp'
|
||||
|
||||
def __init__(self, model: TimeSeriesModel):
|
||||
self.model = model
|
||||
|
||||
def fit(self, X: np.ndarray, y: np.ndarray) -> None:
|
||||
self.model.fit(X, y)
|
||||
|
||||
def predict(self, X) -> tuple[float, np.ndarray]:
|
||||
pred = self.model.predict(X).item()
|
||||
return (pred, np.array([0]))
|
||||
|
||||
def clone(self) -> StatsModel:
|
||||
return StatsModel(deepcopy(self.model))
|
||||
|
||||
def get_name(self) -> str:
|
||||
return self.model.__class__.__name__
|
||||
|
||||
def initialize_network(self, input_dim:int, output_dim:int):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user