There is a pipeline like below.
X is features and
y is the target variable.
I would like to know how
y is passed to the estimator,
LinearSVC. As far as I know,
StandardScalerreturns only transformed
X. So, I thought that
y was not passed to
LinearSVC. However, this code worked and I could make prediction. Thus, I would like to know how
y was reached to the final estimator.
from sklearn.preprocessing import StandardScaler from sklearn.pipeline import Pipeline from sklearn.svm import Linear SVC svm_clf = Pipeline([ ("scaler",StandardScaler()), ("linear_svc",LinearSVC(C=1,loss="hinge")), ]) svm_clf.fit(X,y)