Code Monkey home page Code Monkey logo

dsc-3-34-09-principle-component-analysis-in-scikitlearn-lab's Introduction

Performing Principal Component Analysis (PCA) - Lab

Introduction

Now that you have high level overview of PCA as well as some of the details in the algorithm itself, its time to practice implementing PCA on your own using the NumPy package.

Objectives

You will be able to:

  • Implement PCA from scratch using NumPy

Import the Data

To start, import the data stored in the file 'foodusa.csv'.

#Your code here

Normalize the Data

Next, normalize your data by subtracting the feature mean from each of the columns

#Your code here

Calculate the Covariance Matrix

The next step for PCA is to calculate to covariance matrix for your normalized data. Do so here.

#Your code here

Calculate the Eigenvectors

Next, calculate the eigenvectors for your covariance matrix.

#Your code here

Sorting the Eigenvectors to Determine Primary Components

Great! Now that you have the eigenvectors and their associated eigenvalues, sort the eigenvectors based on their eigenvalues!

#Your code here

Reprojecting the Data

Finally, reproject the dataset using your eigenvectors. Reproject the dataset down to 2 dimensions.

#Your code here

Summary

Well done! You've now coded PCA on your own using NumPy! With that, it's time to look at further application of PCA.

dsc-3-34-09-principle-component-analysis-in-scikitlearn-lab's People

Contributors

loredirick avatar shakeelraja avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsc-3-34-09-principle-component-analysis-in-scikitlearn-lab's Issues

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.