This works the way you would want out of the box.
pipeline takes standard scaler class
No, pipelines get initialized with estimator instances, not the classes. (This is why you need the parentheses in the steps, e.g.
That is, the following works:
from sklearn.datasets import load_breast_cancer
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
X, y = load_breast_cancer(return_X_y=True)
scaler = StandardScaler()
lr = LogisticRegression()
X_sc = scaler.fit_transform(X)
pipe = Pipeline(steps=[('scale', scaler),
# Predicting would fail if the pipeline had unfitted estimators: