About This Book

Python 1.jpg

 

Main Read Now Button.jpg

A comprehensive guide to get you up to speed with the latest developments of practical machine learning with Python and upgrade your understanding of machine learning (ML) algorithms and techniques

Key Features

  • Dive into machine learning algorithms to solve the complex challenges faced by data scientists today
  • Explore cutting edge content reflecting deep learning and reinforcement learning developments
  • Use updated Python libraries such as TensorFlow, PyTorch, and scikit-learn to track machine learning projects end-to-end

Book Description

Python Machine Learning By Example, Third Edition serves as a comprehensive gateway into the world of machine learning (ML).

With six new chapters, on topics including movie recommendation engine development with Naïve Bayes, recognizing faces with support vector machine, predicting stock prices with artificial neural networks, categorizing images of clothing with convolutional neural networks, predicting with sequences using recurring neural networks, and leveraging reinforcement learning for making decisions, the book has been considerably updated for the latest enterprise requirements.

At the same time, this book provides actionable insights on the key fundamentals of ML with Python programming. Hayden applies his expertise to demonstrate implementations of algorithms in Python, both from scratch and with libraries.

Each chapter walks through an industry-adopted application. With the help of realistic examples, you will gain an understanding of the mechanics of ML techniques in areas such as exploratory data analysis, feature engineering, classification, regression, clustering, and NLP.

By the end of this ML Python book, you will have gained a broad picture of the ML ecosystem and will be well-versed in the best practices of applying ML techniques to solve problems.

What you will learn

  • Understand the important concepts in ML and data science
  • Use Python to explore the world of data mining and analytics
  • Scale up model training using varied data complexities with Apache Spark
  • Delve deep into text analysis and NLP using Python libraries such NLTK and Gensim
  • Select and build an ML model and evaluate and optimize its performance
  • Implement ML algorithms from scratch in Python, TensorFlow 2, PyTorch, and scikit-learn

Who this book is for

If you're a machine learning enthusiast, data analyst, or data engineer highly passionate about machine learning and want to begin working on machine learning assignments, this book is for you.

Prior knowledge of Python coding is assumed and basic familiarity with statistical concepts will be beneficial, although this is not necessary.

Book Preview

7

Predicting Stock Prices with Regression Algorithms

In the previous chapter, we trained a classifier on a large click dataset using Spark. In this chapter, we will be solving a problem that interests everyone—predicting stock prices. Getting wealthy by means of smart investment—who isn't interested?! Stock market movements and stock price predictions have been actively researched by a large number of financial, trading, and even technology corporations. A variety of methods have been developed to predict stock prices using machine learning techniques. Herein, we will be focusing on learning several popular regression algorithms, including linear regression, regression trees and regression forests, and support vector regression, and utilizing them to tackle this billion (or trillion) dollar problem.
We will cover the following topics in this chapter:
  • Introducing the stock market and stock prices
  • What is regression?
  • Stock data acquisition and feature engineering
  • The mechanics of linear regression
  • Implementing linear regression (from scratch, and using scikit-learn and TensorFlow)
  • The mechanics of regression trees
  • Implementing regression trees (from scratch and using scikit-learn)
  • From regression tree to regression forest
  • The mechanics of support vector regression and implementing it with scikit-learn
  • Regression performance evaluation
  • Predicting stock prices with regression algorithms

A brief overview of the stock market and stock prices

The stock of a corporation signifies ownership in the corporation. A single share of the stock represents a claim on the fractional assets and the earnings of the corporation in proportion to the total number of shares. For example, if an investor owns 50 shares of stock in a company that has, in total, 1,000 outstanding shares, that investor (or shareholder) would own and have a claim on 5% of the company's assets and earnings.
Stocks of a company can be traded between shareholders and other parties via stock exchanges and organizations. Major stock exchanges include New York Stock Exchange, NASDAQ, London Stock Exchange Group, Shanghai Stock Exchange, and Hong Kong Stock Exchange. The prices that a stock is traded at fluctuate essentially due to the law of supply and demand. At any one moment, the supply is the number of shares that are in the hands of public investors, the demand is the number of shares investors want to buy, and the price of the stock moves up and down in order to attain and maintain equilibrium.
In general, investors want to buy low and sell high. This sounds simple enough, but it's very challenging to implement as it's monumentally difficult to say whether a stock price will go up or down. There are two main streams of studies that attempt to understand factors and conditions that lead to price changes or even to forecast future stock prices, fundamental analysis and technical analysis:
  • Fundamental analysis: This stream focuses on underlying factors that influence a company's value and business, including overall economy and industry conditions from macro perspectives, the company's financial conditions, management, and competitors from micro perspectives.
  • Technical analysis: On the other hand, this stream predicts future price movements through the statistical study of past trading activity, including price movement, volume, and market data. Predicting prices via machine learning techniques is an important topic in technical analysis nowadays.
Many quantitative, or quant, trading firms have been using machine learning to empower automated and algorithmic trading. In this chapter, we'll be working as a quantitative analyst/researcher, exploring how to predict stock prices with several typical machine le...

Table of Content

Table of contents

Preface
Getting Started with Machine Learning and Python
Building a Movie Recommendation Engine with Naïve Bayes
Recognizing Faces with Support Vector Machine
Predicting Online Ad Click-Through with Tree-Based Algorithms
Predicting Online Ads Click-Through with Logistic Regression
Scaling Up Prediction to Terabyte Click Logs
Predicting Stock Prices with Regression Algorithms
Predicting Stock Prices with Artificial Neural Networks
Mining the 20 Newsgroups Dataset with Text Analysis Techniques
Discovering Underlying Topics in the Newsgroups Dataset with Clustering and Topic Modeling
Machine Learning Best Practices
Categorizing Images of Clothing with Convolutional Neural Networks
Making Predictions with Sequences Using Recurrent Neural Networks
Making Decisions in Complex Environments with Reinforcement Learning
Other Books You May Enjoy
Index

Citation styles for Python Machine Learning By Example

Citation styles for Python Machine Learning By ExampleHow to cite Python Machine Learning By Example for your reference list or bibliography: select your referencing style from the list below and hit 'copy' to generate a citation. If your style isn't in the list, you can start a free trial to access over 20 additional styles from the Perlego eReader.
APA 6 Citations
Liu, Y. (2020). Python Machine Learning By Example (3rd ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/2035186/python-machine-learning-by-example-build-intelligent-systems-using-python-tensorflow-2-pytorch-and-scikitlearn-3rd-edition-pdf (Original work published 2020)
Chicago Citation
Liu, Yuxi. (2020) 2020. Python Machine Learning By Example. 3rd ed. Packt Publishing. https://www.perlego.com/book/2035186/python-machine-learning-by-example-build-intelligent-systems-using-python-tensorflow-2-pytorch-and-scikitlearn-3rd-edition-pdf.
Harvard Citation
Liu, Y. (2020) Python Machine Learning By Example. 3rd edn. Packt Publishing. Available at: https://www.perlego.com/book/2035186/python-machine-learning-by-example-build-intelligent-systems-using-python-tensorflow-2-pytorch-and-scikitlearn-3rd-edition-pdf (Accessed: 15 October 2022).
MLA 7 Citation
Liu, Yuxi. Python Machine Learning By Example. 3rd ed. Packt Publishing, 2020. Web. 15 Oct. 2022.

Bulk Ordering

If you are an educational institution or organisation and want to place an order for more than 25 books, please get in touch using the form below and we will be happy to help you with your order.

About the authors

 

Sebastian Raschka is an Assistant Professor of Statistics at the University of Wisconsin-Madison focusing on machine learning and deep learning research. Some of his recent research methods have been applied to solving problems in the field of biometrics for imparting privacy to face images. Other research focus areas include the development of methods related to model evaluation in machine learning, deep learning for ordinal targets, and applications of machine learning to computational biology.

Vahid Mirjalili obtained his Ph.D. in mechanical engineering working on novel methods for large-scale, computational simulations of molecular structures. Currently, he is focusing his research efforts on applications of machine learning in various computer vision projects at the Department of Computer Science and Engineering at Michigan State University. He recently joined 3M Company as a research scientist, where he uses his expertise and applies state-of-the-art machine learning and deep learning techniques to solve real-world problems in various applications to make life better.

Why does this subject matter?

 

  • Publisher ‏ : ‎ Packt Publishing; 3rd edition (30 Oct. 2020)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 526 pages
  • ISBN-10 ‏ : ‎ 1800209711
  • ISBN-13 ‏ : ‎ 978-1800209718