Book Image

Python Machine Learning Blueprints: Intuitive data projects you can relate to

By : Alexander T. Combs
Book Image

Python Machine Learning Blueprints: Intuitive data projects you can relate to

By: Alexander T. Combs

Overview of this book

<p>Machine Learning is transforming the way we understand and interact with the world around us. But how much do you really understand it? How confident are you interacting with the tools and models that drive it?</p> <p>Python Machine Learning Blueprints puts your skills and knowledge to the test, guiding you through the development of some awesome machine learning applications and algorithms with real-world examples that demonstrate how to put concepts into practice.</p> <p>You’ll learn how to use cluster techniques to discover bargain air fares, and apply linear regression to find yourself a cheap apartment – and much more. Everything you learn is backed by a real-world example, whether its data manipulation or statistical modelling.</p> <p>That way you’re never left floundering in theory – you’ll be simply collecting and analyzing data in a way that makes a real impact.</p>
Table of Contents (16 chapters)
Python Machine Learning Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Exploring the features of shareability


The stories that we have collected here represent approximately the 500 most shared pieces of content over the past year. We're going to try to deconstruct these articles to find the common traits that make them so shareable. We'll begin by looking at the image data.

Exploring image data

Let's begin by looking at the number of images that are included with each story. We'll run a value count and then plot the numbers:

dfc['img_count'].value_counts().to_frame('count')

The preceding code generates the following output:

Now, let's plot that same information:

fig, ax = plt.subplots(figsize=(8,6))
y = dfc['img_count'].value_counts().sort_index()
x = y.sort_index().index
plt.bar(x, y, color='k', align='center')
plt.title('Image Count Frequency', fontsize=16, y=1.01)
ax.set_xlim(-.5,5.5)
ax.set_ylabel('Count')
ax.set_xlabel('Number of Images')

The preceding code generates the following output:

Already, the numbers are surprising. The vast majority of stories...