mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 16:43:36 +00:00
* introducing airflow to run pipeline * chore: updating dag with upload to registry * introducing complete provider (non refactored and noisy) * chore: removing old shit * generic pricing baselines * feature: super simple model registry (to be updated maybe third party OS software) * chore: refactoring the providers docker config and requirements * chore: refactored and broke down components (braking * exporting all * local pipeline excution working * fix: fixing import structures from nonrelativistic * chore: enables cross comm pickling with fully e2e pipeline compilation * docs: what the pipeline is like now * pipelines local running and pipeline high level definition * cleaning old pipeline and vectorization * leaked but fixing, not so important * test: started with pipeline step testing * chore: cleaning up provider of prices * test: extra tests wit hsemantic meaning checks * migrating pricers * feature: introducing pricing predictors (pricers) * chore: e2e is done with new pipeline * extra session feature extraction * feature: experiemntal sessin pricer and metrics(vibe) * chore: redefined and connected pricers (#29)
32 lines
935 B
Python
Executable File
32 lines
935 B
Python
Executable File
from abc import ABC, abstractmethod
|
|
from sklearn.base import BaseEstimator, TransformerMixin
|
|
from procesing.context import PipelineContext
|
|
|
|
class BaseContextStep(BaseEstimator, TransformerMixin, ABC):
|
|
"""
|
|
Base for all pipeline steps.
|
|
Each step is stateless, context-driven, and performs ONE transformation.
|
|
"""
|
|
|
|
def __init__(self, context: PipelineContext):
|
|
self.context = context
|
|
|
|
def fit(self, X=None, y=None):
|
|
"""Most steps don't need training"""
|
|
return self
|
|
|
|
@abstractmethod
|
|
def transform(self, X):
|
|
"""Transform input using context. Must be implemented by subclass."""
|
|
pass
|
|
|
|
def get_params(self, deep=True):
|
|
"""sklearn compatibility"""
|
|
return {'context': self.context}
|
|
|
|
def set_params(self, **params):
|
|
"""sklearn compatibility"""
|
|
if 'context' in params:
|
|
self.context = params['context']
|
|
return self
|