title: Obtaining Same Result as Sklearn Pipeline without Using It
body: <p>How would one correctly standardize the data without using pipeline? I am just wanting to make sure my code is correct and there is no data leakage. </p>
  
  <p>So if I standardize the entire dataset once, right at the beginning of my project, and then go on to try different CV tests with different ML algorithms, will that be the same as creating an Sklearn Pipeline and performing the same standardization in conjunction with each ML algorithm?</p>
  
  <pre><code>y = df['y']
  X = df.drop(columns=['y', 'Date'])
  
  scaler = preprocessing.StandardScaler().fit(X)
  X_transformed = scaler.transform(X)
  
  clf1 = DecisionTreeClassifier()
  clf1.fit(X_transformed, y)
  
  clf2 = SVC()
  clf2.fit(X_transformed, y)
  
  ####Is this the same as the below code?####
  
  pipeline1 = []
  pipeline1.append(('standardize', StandardScaler()))
  pipeline1.append(('clf1', DecisionTreeClassifier()))
  pipeline1.fit(X_transformed,y)
  
  pipeline2 = []
  pipeline2.append(('standardize', StandardScaler()))
  pipeline2.append(('clf2', DecisionTreeClassifier()))
  pipeline2.fit(X_transformed,y)
  </code></pre>
  
  <p>Why would anybody choose the latter other than personal preference?</p>