mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-15 20:08:08 +00:00
feat(Models): added StaticAverageModel for average ensembling & StaticNaiveModel (#64)
* 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
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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
|
||||
Reference in New Issue
Block a user