Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Go Machine Learning Projects

You're reading from  Go Machine Learning Projects

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781788993401
Pages 348 pages
Edition 1st Edition
Languages
Author (1):
Xuanyi Chew Xuanyi Chew
Profile icon Xuanyi Chew

Table of Contents (12) Chapters

Preface 1. How to Solve All Machine Learning Problems 2. Linear Regression - House Price Prediction 3. Classification - Spam Email Detection 4. Decomposing CO2 Trends Using Time Series Analysis 5. Clean Up Your Personal Twitter Timeline by Clustering Tweets 6. Neural Networks - MNIST Handwriting Recognition 7. Convolutional Neural Networks - MNIST Handwriting Recognition 8. Basic Facial Detection 9. Hot Dog or Not Hot Dog - Using External Services 10. What's Next? 11. Other Books You May Enjoy

Data massage

When we tested that the data structure made sense, we printed the FullText field. We wish to cluster based on the content of the tweet. What matters to us is that content. This can be found in the FullText field of the struct. Later on in the chapter, we will see how we may use the metadata of the tweets, such as location, to help cluster the tweets better.

As mentioned in the previous sections, each individual tweet needs to be represented as a coordinate in some higher-dimensional space. Thus, our goal is to take all the tweets in a timeline and preprocess them in such a way that we can get this output table:

| Tweet ID | twitter | test | right | wrong |
|:--------:|:------:|:----:|:----:|:---:|
| 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 |

Each row in the table represents a tweet, indexed by the tweet ID. The columns that follow are words that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}