Question 23
Consider the following code snippet:
from sklearn.datasets import fetch_california_housing, load_irisfrom sklearn.decomposition import PCAfrom sklearn.preprocessing import StandardScaler, PolynomialFeaturesfrom sklearn.pipeline import Pipeline, FeatureUnion
X,y = load_iris(return_X_y= True)
polynomial_transform = PolynomialFeatures(degree=3, interaction_only=False, include_bias=False)
combined_features = FeatureUnion([('poly', polynomial_transform), ('pca', PCA(n_components=2))])
pipeline = Pipeline([('features', combined_features), ('scaler', MinMaxScaler())])
X_transformed = pipeline.fit_transform(X)
print(X_transformed.shape)If the shape of X is , what will be the number of features in X_transformed?