Skip to content

Commit

Permalink
Added transformer file with some methods (#151)
Browse files Browse the repository at this point in the history
Co-authored-by: Yimeng Xie <[email protected]>
Co-authored-by: Christopher <[email protected]>
  • Loading branch information
3 people authored Nov 17, 2024
1 parent f73b5ce commit 1088e3a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from sktime.transformations.series.exponent import ExponentTransformer
from sktime.transformations.compose import Id
from sktime.transformations.compose import TransformerPipeline
from sklearn.preprocessing import StandardScaler
import pandas as pd

def run_pipeline(pipeline, data):
'''
run a transformer pipeline given certain data
questions: does the training script provide the pipeline, or should we build this in transformation
do we want to work with only Series->Series or also Panel->Panel
todo: add flag to cache transformed data
add flag to run as list of Series or as Panel
log transformations applied
testing
'''
transformed_data = []
for df in data:
transformed = pipeline.fit_transform(df)
transformed_data.append(transformed)
return transformed_data

def create_pipeline(transformers):
'''
creates a pipeline from a list of transformers (apply all in series)?
questions: how should FeatureUnions be handled?
'''
pipeline = TransformerPipeline(steps=transformers)
return pipeline


0 comments on commit 1088e3a

Please sign in to comment.