3

So I am familiar with Standard Scaler and pipelines with SciKit Learn, but I wanted to know if it's possible to have a conditional within the pipeline such that when a value is put through, one function is used over the other...

Pseudocode

from sklearn.preprocessing import StandardScaler, Normalize
stillness_detection = make_pipeline(IF X > 5,StandardScaler(), 
IF X < 5, Normalize())
GK89
  • 646
  • 5
  • 29
  • There's a possible start to a (very clunky) solution in [this question](https://stackoverflow.com/questions/57838893/how-to-passthrough-skip-pipeline-depend-on-certain-condition). But if it were me, I would just build two pipelines and a function to swap between the two based on passing your condition as an argument – G. Anderson Feb 17 '21 at 16:54

0 Answers0