O código apresentou dois erros:
pca_pipeline[1].explained_variance_ratio_.sum() AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 pca_pipeline[1].explained_variance_ratio_.sum()
AttributeError: 'PCA' object has no attribute 'explained_variance_ratio_'
e também:
pca_pipeline[1].explained_variance_.sum() AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 pca_pipeline[1].explained_variance_.sum()
AttributeError: 'PCA' object has no attribute 'explained_variance_'