mirror of
https://github.com/webclinic017/drift.git
synced 2026-08-23 07:48:09 +00:00
chore(Linter): reformatted code with black (#211)
* chore(Linter): reformatted code with black * Create black.yaml
This commit is contained in:
+9
-8
@@ -3,14 +3,15 @@ import numpy as np
|
||||
from .base import Model
|
||||
from sklearn.base import BaseEstimator, ClassifierMixin
|
||||
|
||||
class StaticMomentumModel(BaseEstimator, ClassifierMixin, Model):
|
||||
'''
|
||||
Model that uses only one feature: momentum. It's positive if momentum is greater than 0, otherwise it's negative.
|
||||
'''
|
||||
|
||||
data_transformation = 'original'
|
||||
only_column = 'mom'
|
||||
predict_window_size = 'single_timestamp'
|
||||
class StaticMomentumModel(BaseEstimator, ClassifierMixin, Model):
|
||||
"""
|
||||
Model that uses only one feature: momentum. It's positive if momentum is greater than 0, otherwise it's negative.
|
||||
"""
|
||||
|
||||
data_transformation = "original"
|
||||
only_column = "mom"
|
||||
predict_window_size = "single_timestamp"
|
||||
|
||||
def __init__(self, allow_short: bool) -> None:
|
||||
super().__init__()
|
||||
@@ -24,6 +25,6 @@ class StaticMomentumModel(BaseEstimator, ClassifierMixin, Model):
|
||||
negative_class = -1.0 if self.allow_short == True else 0.0
|
||||
prediction = 1.0 if X[-1][0] > 0 else negative_class
|
||||
return np.array(prediction)
|
||||
|
||||
|
||||
def predict_proba(self, X) -> np.ndarray:
|
||||
return np.array([])
|
||||
|
||||
Reference in New Issue
Block a user