mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-01 21:27:46 +00:00
d3d7184ea4
* feat(Models): added StaticAverageModel for average ensembling * feat(Models): made sure we only pipe in predictions to StaticAverageModel, added StaticNaiveModel as potential baseline * chore(Models): removed unnecessary commented out code
21 lines
468 B
Python
21 lines
468 B
Python
from models.base import Model
|
|
import numpy as np
|
|
|
|
class StaticNaiveModel(Model):
|
|
'''
|
|
Model that carries the last observation (from returns) to the next one, naively.
|
|
'''
|
|
|
|
# data_format = 'dataframe'
|
|
data_scaling = 'unscaled'
|
|
only_column = None
|
|
|
|
def fit(self, X, y):
|
|
# This is a static model, it can' learn anything
|
|
pass
|
|
|
|
def predict(self, X):
|
|
return np.array([X[-1][0]])
|
|
|
|
def clone(self):
|
|
return self |