Files
drift/models/naive.py
T
Mark Aron Szulyovszky b6cd6b14fe feat(Config): feature extractors are enabled one-by-one with a bool, added previous model to model.fit() (#77)
* feat(Config): feature extractors are enabled one-by-one with a bool, added previous model to model.fit()

* fix(Sweep): removed unused `other_features` parameter that fails sweep

* feat(Config): using preset names for defining feature extractors again

* fix(Tests): fixed model stub classes
2021-12-23 10:35:20 +01:00

21 lines
480 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, prev_model):
# 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