mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-28 11:17:47 +00:00
f762ceed2a
* feat(FeatureExtraction): added fractionally differentiated returns to remove lagged returns * fix(Sweep): config * fix(Sweep): name * fix(Sweep): grid * feat(Config): separated sliding_window_size_level1 & sliding_window_size_level2 * feat(Dependencies): added ray, now using it to parallel process feature extraction * fix(Dependencies): added pip explicitly * fix(Dependencies): removed ray from root * fix(Models): average model was probably not taking the right timestamp to average * feat(Config): separated expanding_window_level1 & expanding_window_level2 * fix(Config): set n_features_to_select to the optimal 30
25 lines
566 B
Python
25 lines
566 B
Python
from models.base import Model
|
|
import numpy as np
|
|
|
|
class StaticAverageModel(Model):
|
|
'''
|
|
Model that averages .
|
|
'''
|
|
|
|
data_scaling = 'unscaled'
|
|
only_column = 'model_'
|
|
feature_selection = 'off'
|
|
model_type = 'static'
|
|
|
|
def fit(self, X, y, prev_model):
|
|
# This is a static model, it can' learn anything
|
|
pass
|
|
|
|
def predict(self, X):
|
|
# Make sure there's data to average
|
|
assert X.shape[1] > 0
|
|
prediction = np.average(X[-1])
|
|
return np.array([prediction])
|
|
|
|
def clone(self):
|
|
return self |