initial cleaning after refactoring

This commit is contained in:
Oleg Sheynin
2025-07-30 23:15:24 +00:00
parent 1b6b5e5735
commit b474752959
22 changed files with 105 additions and 13 deletions
+7 -3
View File
@@ -14,6 +14,8 @@ class DataParams:
class ModelDataPolicy(ABC):
config_: Dict[str, Any]
current_data_params_: DataParams
count_:int
def __init__(self, config: Dict[str, Any]):
self.config_ = config
@@ -21,10 +23,12 @@ class ModelDataPolicy(ABC):
training_size=config.get("training_size", 120),
training_start_index=0,
)
self.count_ = 0
@abstractmethod
def advance(self) -> DataParams:
...
self.count_ += 1
print(self.count_, end='\r')
@staticmethod
def create(config: Dict[str, Any]) -> ModelDataPolicy:
@@ -43,9 +47,8 @@ class RollingWindowDataPolicy(ModelDataPolicy):
self.count_ = 1
def advance(self) -> DataParams:
super().advance()
self.current_data_params_.training_start_index += 1
print(self.count_, end='\r')
self.count_ += 1
return self.current_data_params_
@@ -54,6 +57,7 @@ class ExpandingWindowDataPolicy(ModelDataPolicy):
super().__init__(config)
def advance(self) -> DataParams:
super().advance()
self.current_data_params_.training_size += 1
return self.current_data_params_