Giter Site home page Giter Site logo

fardinabbasi / pca Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13.02 MB

Machine Learning Course [ECE 501] - Spring 2023 - University of Tehran - Dr. A. Dehaqani, Dr. Tavassolipour

Jupyter Notebook 100.00%
eigenfaces eigenvalues eigenvectors elbow-method knee-point pca

pca's Introduction

Principal Component Analysis

A common technique for image compression is principal component analysis (PCA). Image quality and compression ratio depend on the number of principal components.

Performing PCA on the "emotion_detection" dataset contains 213 images with 6 labels: Happy, Fear, Angry, Disgust, Surprise, and Sad.

How does PCA work?

First, the original data is normalized to have a mean of 0 and a variance of 1.

Next, the normalized data is transformed into another feature space through projection on the eigenvectors (U): $Z = U^T X$.

The procedure for finding U is illustrated below.

Best n_components

The eigenvalues are presented below in descending order.

The elbow method is employed to select the optimal n_components, which involves retaining data projections only onto principal components with significant eigenvalues.

Eigenfaces

Eigenfaces are a set of eigenvectors that are used in facial recognition and image compression.

Below are the first four eigenfaces with the largest eigenvalues.

Below are the last four eigenfaces with the smallest eigenvalues.

pca's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.