Question 16
Consider following data and code snippet:
from sklearn.compose import ColumnTransformerfrom sklearn.preprocessing import MinMaxScaler, OrdinalEncoder, MaxAbsScalerfrom sklearn.impute import SimpleImputerfrom sklearn.pipeline import Pipeline
X = np.array([[5, 4, 'cat'], [4, -1, 'dog'], [3, 1, 'bird'], [np.nan, 3, 'cat']])
impute_scale_pipe = Pipeline([('impute', SimpleImputer()), ('scale', MinMaxScaler())])
ct = ColumnTransformer([('impute_scale', impute_scale_pipe, [0,1]), ('scale_only', MaxAbsScaler(), [1]), ('categorical', OrdinalEncoder(), [2])])transformed_X = ct.fit_transform(X)Based on the above data, answer the given subquestions.
What will be the output of the following code snippet:
Enter -1, if you think the above code snippet will generate an error.