The breast cancer dataset has 30 columns, and many of them repeat each other. How many PCA directions does it take to hold a given share of the variation?
Task: write directions_needed(threshold).
load_breast_cancer(return_X_y=True).StandardScaler().fit_transform(X).PCA(n_components=threshold), where threshold is a fraction between 0 and 1.[number_of_directions_kept, total_share_kept]. The first is a plain int. The second is the sum of explained_variance_ratio_, as a plain float rounded to 3 decimal places.