NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Student Works > What do Great Thinkers Think About?

What do Great Thinkers Think About?

Joshua Litven
Posted on Nov 17, 2016

In the information age, we are bombarded with more and more information, the quality of which is often suspect. As Nate Silver points out in The Signal and the Noise, more data does not mean better decisions. We run the risk of forgetting the lessons of history and in particular the universal truths that great thinkers have distilled from deep contemplation throughout the ages.

For my web scraping project, I wanted to answer the following question:

What do the great thinkers think about, and what are the relationships between them?

Why is this an important question? Great thinkers expose us to new ideas, lead the advancement of progress and ultimately change the world. Their ideas teach us how to live a happy and spiritually splendid life.

To answer this question, I collected quotes from great thinkers, and developed a Shiny app which serves as an educational tool for exploring great thinkers and their ideas.

Data

The first challenge was to determine who the great thinkers were. Pantheon is a collaborative MIT educational project that provides a dataset of 11,341 historical figures spanning the past 6000 years throughout the world. They also provide some very cool visualizations of the data, as seen below.

pantheon

The Pantheon website.

Bias Alert

How does one define "historical significance"? Pantheon uses a fancy equation based on wikipedia pages: This is of course biased. By their metric, Shania Twain is more historically significant than Mark Twain. Their methods section discusses this bias, as highlighted below.

 

biases

(Source: http://pantheon.media.mit.edu/methods)

It is important to note this is a sample biased towards figures found on Wikipedia, and generally, in Western culture. Using the .csv file provided by Pantheon containing their historical list of figures, the next step was to scrape their quotes.

Scraping

The website BrainyQuote contains quotes of influential individuals, often accompanied by uplifting and cheesy images.

brainyquote

This is Mark Twain. Actually it's two goats.

I scraped author quotes using the handy library Scrapy in Python. While scraping the quotes was a fairly straightforward process, the challenge was in connecting the Pantheon data set with authors on BrainyQuote.

The gist of the scraping algorithm is:

  • Iterate through each figure in the Pantheon data set
  • Search their name on BrainyQuote website
  • Check that resulting page contains found authors
  • Try to match the figure in Pantheon with the found authors
  • If matched, scrape their quotes pages
  • If not matched, add the name to a list of missing authors

The full scraping "spider" is given below.

Bias Alert II

We now have a second sampling bias: Only authors found on Pantheon and BrainyQuote are considered. The results of scraping reduced the number of figures to 4295 quotable humans: Less than half of the total on Pantheon. This is because many could not be matched exactly, as can be seen by a portion of the missing authors text file.

Afonso XII of Spain may have said some interesting things, but unfortunately not included in this analysis.

Afonso XII of Spain may have said some interesting things, but is unfortunately not included in this analysis.

Now that the biases and limitations of the data have been discussed, we can (finally!) move on to the model.

Vector Space Model

With author quotes scraped, I wanted to quantify their similarity and uniqueness. To do so, I employed the vector space model, often used in information filtering and retrieval systems. Briefly, the vector space model represents documents (d1, ..., dn) as vectors in an n-dimensional space, where each dimension corresponds to a word in the corpus. If a word occurs in a document, its component in that dimension will be non-zero. A query q is then represented as a vector and similarities between documents and the query are computed using the angle between them, as show in the graphic below.

 

The vector space model (source: wikipedia.com)

The vector space model (source: wikipedia.com)

For this analysis, a document is simply an author's consolidated quotes. There are several ways to assign weights to words in a document vector: I chose the popular method term frequency inverse document frequency (TF-IDF).

TF-IDF does exactly what its ridiculously long-winded name implies: It weights terms (i.e. words) by the frequency they appear in a document, and inversely to the frequency they appear in all documents. The latter weighting ensures terms that don't appear often in the corpus are weighted higher. For example, if only one document uses the word "ballet", we would want to weight that word higher than words that appear in several documents.

Upon quantifying the compiled wisdom into good old vectors, we can start to investigate.

Insights

I first wanted to investigate the effectiveness of the vector space model by seeing the most common words in various categories. Below is a breakdown of highest TF-IDF words by the domain of the authors.

tfidf_domain

The plot shows what we would expect: Quotes in a domain contain words related to that domain. Arts, for example, contain songs, film, actress, while exploration contain shuttle, astronauts, lunar etc. One interesting note is that the outdated term "tis" was marked in the humanities, indicating that possibly older authors are grouped primarily into this domain. 'Tis a shame we don't use this word anymore!

I then wanted to see how word usage changed throughout time. The highest TF-IDF terms by century is shown below.

tf_idf_century

Here we have some fascinating insights. Before 1000, "gods" (note the plural) is the highest term. As we move through the early centuries, we see words that are antiquated: iniquity, righteousness, doth, maketh etc. It is also interesting to see bodies, motion and gravity appear in the 17th century, coinciding to the scientific revolution when Newton formulated his theory of gravity. The 18th century contains government, rights, and liberty, indicating that this century was rife with political change, namely, the formation of the United States and the French revolution. The modern centuries reflect the skew in the data: The 19th century has "american" and "america", while the 20th century has "film", "movies", "films", and "actors". This is not surprising given the fact that the majority of authors on BrainyQuote are celebrities.

Author Similarity

As mentioned above, similarities between documents in a vector space model can be computed using the angles between them, which in practice uses the cosine similarity.  Using this similarity we can construct a similarity matrix which stores all pair-wise similarities between documents. Below is the code in R I used to compute the similarity matrix of authors using the quanteda library.

Once the similarity matrix is constructed, we can find the most similar authors to a given author based on their quotes:

When we search for Aristotle, we get Plato, Ralph Waldo Emerson, Samuel Johnson, Francis Bacon etc. This seems like a reasonable result, but how can assess the similarity matrix quantitatively?

K-Nearest Neighbours

We want to get a sense of the goodness of fit of the similarity matrix. Ideally we'd have labelled data telling us which authors were similar to use in an assessment. In lieu of this data, I decided to use the similarity matrix to predict whether similar artists were in the same domain based on the assumption that similar artists should often be in the same domain. The idea is that if the similarity matrix reflects true similarity among authors, the model will perform better than random chance.

For the model I used the K-Nearest Neighbours (KNN) algorithm to predict an author's domain. Briefly, given an integer k and a point to predict, KNN selects the k closest points to the given point and classifies it based on the majority vote of the neighbouring points. For example, if k = 3 and two of the most similar authors of a given author are arts, the author will also be classified as arts.

Below is a graph depicting the accuracy over varying levels of k.

knn_accuracy_plot

What is this telling us? For k=1, We get the best accuracy of about 70%, and as k increases the accuracy linearly decreases to about 50% when k=10. In other words, the most similar author is in the same domain about 70% of the time. This gives us some confidence that the similarity matrix is effective at representing similarity. We would not expect the accuracy to be too high, because similar authors aren't necessarily always in the same domain.

The goal of this project was to find similar thinkers, irrespective of their domains.

To further elucidate on this point, the Shiny app allows you to explore the authors in space and time, as seen below.

shiny_malcolm

Malcolm X shown in the Great Thinkers Shiny app.

We see the civil rights activist Malcolm X, along with his quotes on the bottom and similar thinkers on the right. Notice that two of the three similar authors, Martin Luther King Jr. and Rosa Parks, are also social activists. The second most similar author, Paul Robeson, is actually a singer. This seems surprising until you read his biography:

Paul Leroy Robeson (/หˆroสŠbsษ™n/; April 9, 1898 โ€“ January 23, 1976) was an American bass singer and actor who became involved with the Civil Rights Movement. (Source: wikipedia)

We see that he was a singer involved in the civil rights movement. This is an example of how the model finds similarities in the author's thoughts that extend beyond occupation, place and time.

Future Work

The vector space model could easily be extended to a content-based filtering recommendation system, which would allow users to like certain authors and get a list of recommended authors in the Shiny app. Similarity could also be improved by incorporating sentiment analysis and metrics such as occupation, geography, and time period.

Conclusions

By analyzing our data of the thoughts of the great thinkers, we see expected words in various domains, and interesting trends of word usage through time, including antiquated terms in the past as well as a bias towards celebrities in more recent times. A vector space model is a simple representation of authors that allowed us to compute similarities which was used to build an interactive Shiny app to explore great thinkers in time and space. The validity of the similariarities was  assessed using the KNN algorithm which gave us some confidence that the model was working correctly.

References

  • The Signal and the Noise
  • Pantheon
  • BrainyQuote
  • Vector Space Model
  • TF-IDF
  • Cosine Similarity
  • K-Nearest Neighbours

About Author

Joshua Litven

Joshua Litven received his Master's degree in Computer Science at the University of British Columbia where he worked on developing parallel algorithms to simulate realistic collisions between highly deformable objects. In practice, this meant watching lots of virtual...
View all posts by Joshua Litven >

Related Articles

Data Visualization
Yunnan Sourcing Tea Storefront and Analysis of the High End Tea Market
Student Works
Data Analysis on Streaming Platforms
Data Visualization
The Budget Traveler's Data Guide to Southeast Asia
Student Works
Data Analysis on Job Satisfaction
Python
NYC Real Estate Housing Web Scraping Project

Leave a Comment

Cancel reply

You must be logged in to post a comment.

Google January 25, 2021
Google Here is a great Weblog You might Come across Fascinating that we encourage you to visit.
Google January 10, 2021
Google One of our guests a short while ago proposed the following website.
Google August 8, 2020
Google Although websites we backlink to beneath are considerably not associated to ours, we feel they are essentially really worth a go by means of, so possess a look.
Google July 4, 2020
Google Usually posts some quite intriguing stuff like this. If youย’re new to this site.
fucking March 14, 2017
I visit every day some blogs and sites to read content, however this web site provides quality based writing.
What do Great Thinkers Think About? | Joshua Litven November 28, 2016
[โ€ฆ] Check out another post from my program at NYC Data Science Program: What do Great Thinkers Think About? [โ€ฆ]

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application