Coder Social home page Coder Social logo

ada-pca-dram's Introduction

ADA: Dram Shop PCA

In this assignment we use PCA to investigate purchasing habits of Dram Shop customers. Since the Dram Shop has so many items, we need dimensionality reduction to help us understand the patterns of consumption. This assignment does not start you with any code, so you'll need to create a Jupyter notebook to hold your analysis.

Here are the steps you'll undertake:

  1. Write a query in GBQ that pulls the data in the view vw_customers_top_1k_items. This view has the customer identifier and the customer's history with the item. This view is limited to the top 1000 items in terms of total spend, though you could easily modify things for your purpose. You may want to collapse this to "clean_item_name" instead of "catalog_object_id" to reduce the processing time.
  2. Using the pandas function pivot, pivot the data into a "wide" format with customer IDs as the rows and beverages as the items. You can see an example here.
  3. Using the PCA function from sklearn.decomposition, perform a PCA on this data set. Plot the amount of explained variation in the first 20 components.
  4. For each of the first 6 components, print the items with the 15 largest loadings in absolute value.
  5. Write up a brief interpretation on what aspect of the data that component seems to be capturing.

ada-pca-dram's People

Contributors

37chandler 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.