Consider the following preprocessing pipeline: from sklearn….
Consider the following preprocessing pipeline: from sklearn.pipeline import Pipelinefrom sklearn.compose import ColumnTransformerfrom sklearn.preprocessing import StandardScaler, OneHotEncoderpipeline = Pipeline([ (‘preprocess’, ColumnTransformer([ (‘scaler’, StandardScaler(), [‘height’, ‘length’]), (‘encoder’, OneHotEncoder(), [‘color’]) ], remainder=’drop’))]) Suppose your DataFrame df has three columns: height and length (both numeric) color with exactly three possible categories: ‘red’, ‘blue’, and ‘green’ After running X_transformed = pipeline.fit_transform(df), how many columns will X_transformed have?
Read Details