Python Machine Learning Blueprints - Second Edition

Book description

Discover a project-based approach to mastering machine learning concepts by applying them to everyday problems using libraries such as scikit-learn, TensorFlow, and Keras

Key Features

  • Get to grips with Python's machine learning libraries including scikit-learn, TensorFlow, and Keras
  • Implement advanced concepts and popular machine learning algorithms in real-world projects
  • Build analytics, computer vision, and neural network projects

Book Description

Machine learning is transforming the way we understand and interact with the world around us. This book is the perfect guide for you to put your knowledge and skills into practice and use the Python ecosystem to cover key domains in machine learning. This second edition covers a range of libraries from the Python ecosystem, including TensorFlow and Keras, to help you implement real-world machine learning projects.

The book begins by giving you an overview of machine learning with Python. With the help of complex datasets and optimized techniques, you'll go on to understand how to apply advanced concepts and popular machine learning algorithms to real-world projects. Next, you'll cover projects from domains such as predictive analytics to analyze the stock market and recommendation systems for GitHub repositories. In addition to this, you'll also work on projects from the NLP domain to create a custom news feed using frameworks such as scikit-learn, TensorFlow, and Keras. Following this, you'll learn how to build an advanced chatbot, and scale things up using PySpark. In the concluding chapters, you can look forward to exciting insights into deep learning and you'll even create an application using computer vision and neural networks.

By the end of this book, you'll be able to analyze data seamlessly and make a powerful impact through your projects.

What you will learn

  • Understand the Python data science stack and commonly used algorithms
  • Build a model to forecast the performance of an Initial Public Offering (IPO) over an initial discrete trading window
  • Understand NLP concepts by creating a custom news feed
  • Create applications that will recommend GitHub repositories based on ones you've starred, watched, or forked
  • Gain the skills to build a chatbot from scratch using PySpark
  • Develop a market-prediction app using stock data
  • Delve into advanced concepts such as computer vision, neural networks, and deep learning

Who this book is for

This book is for machine learning practitioners, data scientists, and deep learning enthusiasts who want to take their machine learning skills to the next level by building real-world projects. The intermediate-level guide will help you to implement libraries from the Python ecosystem to build a variety of projects addressing various machine learning domains. Knowledge of Python programming and machine learning concepts will be helpful.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Python Machine Learning Blueprints Second Edition
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. The Python Machine Learning Ecosystem
    1. Data science/machine learning workflow
      1. Acquisition
      2. Inspection
      3. Preparation
      4. Modeling
      5. Evaluation
      6. Deployment
    2. Python libraries and functions for each stage of the data science workflow
      1. Acquisition
      2. Inspection
        1. The Jupyter Notebook
        2. Pandas
        3. Visualization
          1. The matplotlib library
          2. The seaborn library
      3. Preparation
        1. map
        2. apply
        3. applymap
        4. groupby
      4. Modeling and evaluation
        1. Statsmodels
        2. Scikit-learn
      5. Deployment
    3. Setting up your machine learning environment
    4. Summary
  7. Build an App to Find Underpriced Apartments
    1. Sourcing apartment listing data
      1. Pulling down listing data
      2. Pulling out the individual data points
      3. Parsing data
    2. Inspecting and preparing the data
      1. Sneak-peek at the data types
    3. Visualizing our data
    4. Visualizing the data
    5. Modeling the data
      1. Forecasting
    6. Extending the model
    7. Summary
  8. Build an App to Find Cheap Airfares
    1. Sourcing airfare pricing data
    2. Retrieving fare data with advanced web scraping
      1. Creating a link
    3. Parsing the DOM to extract pricing data
      1. Parsing
    4. Identifying outlier fares with anomaly detection techniques
    5. Sending real-time alerts using IFTTT
    6. Putting it all together
    7. Summary
  9. Forecast the IPO Market Using Logistic Regression
    1. The IPO market
      1. What is an IPO?
      2. Recent IPO market performance
      3. Working on the DataFrame
      4. Analyzing the data
      5. Summarizing the performance of the stocks
      6. Baseline IPO strategy
    2. Data cleansing and feature engineering
      1. Adding features to influence the performance of an IPO
    3. Binary classification with logistic regression
      1. Creating the target for our model
      2. Dummy coding
      3. Examining the model performance
    4. Generating the importance of a feature from our model
      1. Random forest classifier method
    5. Summary
  10. Create a Custom Newsfeed
    1. Creating a supervised training set with Pocket
      1. Installing the Pocket Chrome Extension
      2. Using the Pocket API to retrieve stories
    2. Using the Embedly API to download story bodies
    3. Basics of Natural Language Processing
    4. Support Vector Machines
    5. IFTTT integration with feeds, Google Sheets, and email
      1. Setting up news feeds and Google Sheets through IFTTT
    6. Setting up your daily personal newsletter
    7. Summary
  11. Predict whether Your Content Will Go Viral
    1. What does research tell us about virality?
    2. Sourcing shared counts and content
    3. Exploring the features of shareability
      1. Exploring image data
      2. Clustering
      3. Exploring the headlines
      4. Exploring the story content
    4. Building a predictive content scoring model
      1. Evaluating the model
      2. Adding new features to our model
    5. Summary
  12. Use Machine Learning to Forecast the Stock Market
    1. Types of market analysis
    2. What does research tell us about the stock market?
      1. So, what exactly is a momentum strategy?
    3. How to develop a trading strategy
      1. Analysis of the data
      2. Volatility of the returns
      3. Daily returns
      4. Statistics for the strategies
      5. The mystery strategy
    4. Building the regression model
      1. Performance of the model
      2. Dynamic time warping
      3. Evaluating our trades
    5. Summary
  13. Classifying Images with Convolutional Neural Networks
    1. Image-feature extraction
    2. Convolutional neural networks
      1. Network topology
      2. Convolutional layers and filters
      3. Max pooling layers
      4. Flattening
      5. Fully-connected layers and output
    3. Building a convolutional neural network to classify images in the Zalando Research dataset, using Keras
    4. Summary
  14. Building a Chatbot
    1. The Turing Test
    2. The history of chatbots
    3. The design of chatbots
    4. Building a chatbot
    5. Sequence-to-sequence modeling for chatbots
    6. Summary
  15. Build a Recommendation Engine
    1. Collaborative filtering
      1. So, what's collaborative filtering?
      2. Predicting the rating for the product
    2. Content-based filtering
    3. Hybrid systems
      1. Collaborative filtering
      2. Content-based filtering
    4. Building a recommendation engine
    5. Summary
  16. What's Next?
    1. Summary of the projects
    2. Summary
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Python Machine Learning Blueprints - Second Edition
  • Author(s): Alexander Combs, Michael Roman
  • Release date: January 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781788994170