Coder Social home page Coder Social logo

clustering_visualization's Introduction

문서 군집화를 한 뒤, 이를 시각화 하는 튜토리얼입니다.

시각화에는 t-SNE 알고리즘이 자주 이용이 되곤 합니다. 하지만, t-SNE는 학습 과정에서 만들어지는 P의 품질에 따라 임베딩 결과가 확연하게 달라집니다. 또한 이미 문서 군집화를 수행하였다면, 문서 군집화 결과를 모델에 반영하고 싶지만, unsupervised로 진행되는 학습 과정에 이 정보를 반영하는건 쉽지 않습니다.

이 튜토리얼에서는 172개 영화의 네이버영화 평점 리뷰를 바탕으로 Doc2Vec을 학습했던 document vectors를 군집화 한 뒤, 시각화 하는 방법을 소개합니다.

Plot을 함께 봐야 하기 때문에 github의 tutorial (click)을 살펴보시기 바랍니다.

172개 영화는 100차원으로 Doc2Vec을 이용하여 표현되었습니다. 하지만 이를 t-SNE로 그대로 임베딩할 경우, 하나의 군집에 속하는 영화들이 흩어지게 됩니다.

snap0

우리는 문서 군집화까지 해뒀습니다. 이 결과를 시각화 과정에서 반영해야 문서 군집화 결과를 잘 설명하는 시각화가 될 것입니다. 하지만 t-SNE의 학습 과정에서 군집화의 결과를 이용하지 않았기 때문에 아래처럼 한 군집에 속하는 문서들이라 하더라도 흩어지게 됩니다.

snap1

차라리, 군집화 결과의 centroids를 아래 그림처럼 임베딩해두고, 각 군집에 속한 문서들은 해당 centroid 주변에 뿌려두는 것이 군집화의 결과를 설명하기에 더 적절할 것입니다.

snap2

이를 위해서 아래 그림처럼 각 군집의 centroids를 먼저 임베딩하고, 그 점들간의 voronoi 경계를 지키면서, 각 점과 군집중심과의 거리에 비레하도록 데이터 포인트를 뿌려둡니다. 그 과정은 위 링크의 튜토리얼에 적어뒀습니다.

snap3

clustering_visualization's People

Contributors

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