← Back to all experiments
ClassificationAdvancedPCAGaussian Naive Bayes

EXP9: PCA + Naive Bayes Faces

Classifies Olivetti faces using PCA + Gaussian Naive Bayes.

Key highlights

  • Reduces 4096 features to 50
  • Evaluates accuracy on holdout set
  • Shows sample predictions

Metrics

Accuracy

Outputs

Face prediction sample
Sample prediction visual
Face prediction sample
Additional sample prediction

Full Python Code

The complete Python script directly from the repository.

Python
pca = PCA(n_components=50)
X_pca = pca.fit_transform(X)
nb_classifier.fit(X_train, y_train)

Next steps

Want to explore further? Try the full gallery or open the raw script to tweak parameters.