GithubHelp home page GithubHelp logo

eeddaann / data-science-topic-modeling Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 475 KB

Using data science for explaining what is data science..

Jupyter Notebook 100.00%
data-science topic-modeling lda pyldavis gensim stack-exchange nlp clustering

data-science-topic-modeling's Introduction

data-science topic modeling - Using data science for explaining what is data science..

note: for viewing and playing with the results, click here

Data collection

This project is based on "Data Science Stack Exchange" - website which dedicated to questions and answers about data science.

And "Cross Validated" which is more focused on statistics.

To extract the tags from all the posts there I ran the following query in stack exchange's Data Explorer:

SELECT Tags 
FROM Posts
WHERE Tags IS NOT NULL

The query result looks like this:

<machine-learning><neural-network><deep-learning>
<statistics><time-series>
<machine-learning>
<python><keras><convnet><audio-recognition>
<statistics><unbalanced-classes>

Where each row represents a post.

extract transform load

Convert the data into list of lists:

(we use 2 data sources: "Data Science Stack Exchange" and "Cross Validated")

lst = []
reader = csv.reader(open('QueryResults.csv'))
for line in reader:
    lst.append(unicode(line)[3:-3].split('><'))
reader2 = csv.reader(open('QueryResults2.csv'))
for line in reader2:
    lst.append(unicode(line)[3:-3].split('><'))

After we converted the data into list of lists, we used gensim to format the data :

dictionary = gensim.corpora.Dictionary(lst)
corpus = [dictionary.doc2bow(gen_doc) for gen_doc in lst]
lda = gensim.models.ldamodel.LdaModel(corpus=corpus, id2word=dictionary, num_topics=8)

The most important parameter here is the num_topics which determine for how many topics we want to divide the model - too many topics will result in very narrow topics but too few may lead to ambiguous topics..

visualization

For visualization we used pyLDAvis

data-science-topic-modeling's People

Contributors

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