PCA is a transformer like a scaler, so it can sit inside a pipeline in front of a model. How few directions can a classifier get away with?
Task: write accuracy_with_directions(n_components).
load_breast_cancer(return_X_y=True).train_test_split(X, y, test_size=0.25, random_state=0, stratify=y).make_pipeline(StandardScaler(), PCA(n_components=n_components), LogisticRegression(max_iter=1000)) and fit it on the training rows.