Question 13
Consider the following code snippet:
from sklearn.datasets import fetch_california_housingfrom sklearn.decomposition import PCAfrom sklearn.preprocessing import StandardScaler, PolynomialFeaturesfrom sklearn.pipeline import Pipeline, FeatureUnion
data = fetch_california_housing()X = data.data
polynomial_transform = PolynomialFeatures(degree=2, include_bias=False)pca_transform = PCA(n_components=5)scaler = StandardScaler()
combined_features = FeatureUnion([ ('poly', polynomial_transform), ('pca', pca_transform)])
pipeline = Pipeline([ ('features', combined_features), ('scaler', scaler)])
X_transformed = pipeline.fit_transform(X)print(X_transformed.shape)If the shape of X is , what will be the shape of X_transformed?
(20640, 8)
(20640, 5)
(20640, 44)
(20640, 49)