Giter VIP home page Giter VIP logo

iterative-hc's Introduction

iterative-hc

Recursive hierarchical clustering to overcome missing variables

The purpose of this script is to do Exploratory analysis of how similar the demand of each country is to one another. Instead of using actual country or product features, I am using the approach of comparing weighted demand of SKU products to represent preference of a country relative to another.

I wish to believe the problem with the missing data is that the products might not be offered to the countries in the first place. If that is the case, it is unfair to compare no sales for a country that could not have had demand should there be no sellers. Yet, the dropna() method reduces my dataset drastically, dropping valuable information.

This inspired me to think of a novel method of iteratively doing clustering by a filtered set, tagging the cluster similarity in a correlation matrix, subsequently observing the results.

The logic runs as follows:

  1. Randomly select 7 countries
  2. Keep common products offered as features
  3. Weight sold quantity values down
  4. Perform clustering technique (KMeans in my case)
  5. Tag if same (+1) or different (-1) if two countries are in the same or different cluster
  6. Loop Steps 1-5 for 100 times (specified by user)
  7. Calculate average correlation matrix table
  8. Plot correlation matrix using a gradient chart

I am using the public dataset Online Retail Data Set for the purpose of this tutorial.

iterative-hc's People

Contributors

tanfiona avatar

Watchers

 avatar  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.