O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Machine Learning for Developers

Book Description

Your one-stop guide to becoming a Machine Learning expert.

About This Book

  • Learn to develop efficient and intelligent applications by leveraging the power of Machine Learning
  • A highly practical guide explaining the concepts of problem solving in the easiest possible manner
  • Implement Machine Learning in the most practical way

Who This Book Is For

This book will appeal to any developer who wants to know what Machine Learning is and is keen to use Machine Learning to make their day-to-day apps fast, high performing, and accurate. Any developer who wants to enter the field of Machine Learning can effectively use this book as an entry point.

What You Will Learn

  • Learn the math and mechanics of Machine Learning via a developer-friendly approach
  • Get to grips with widely used Machine Learning algorithms/techniques and how to use them to solve real problems
  • Get a feel for advanced concepts, using popular programming frameworks.
  • Prepare yourself and other developers for working in the new ubiquitous field of Machine Learning
  • Get an overview of the most well known and powerful tools, to solve computing problems using Machine Learning.
  • Get an intuitive and down-to-earth introduction to current Machine Learning areas, and apply these concepts on interesting and cutting-edge problems.

In Detail

Most of us have heard about the term Machine Learning, but surprisingly the question frequently asked by developers across the globe is, ?How do I get started in Machine Learning??. One reason could be attributed to the vastness of the subject area because people often get overwhelmed by the abstractness of ML and terms such as regression, supervised learning, probability density function, and so on. This book is a systematic guide teaching you how to implement various Machine Learning techniques and their day-to-day application and development.

You will start with the very basics of data and mathematical models in easy-to-follow language that you are familiar with; you will feel at home while implementing the examples. The book will introduce you to various libraries and frameworks used in the world of Machine Learning, and then, without wasting any time, you will get to the point and implement Regression, Clustering, classification, Neural networks, and more with fun examples. As you get to grips with the techniques, you'll learn to implement those concepts to solve real-world scenarios for ML applications such as image analysis, Natural Language processing, and anomaly detections of time series data.

By the end of the book, you will have learned various ML techniques to develop more efficient and intelligent applications.

Style and approach

This book gives you a glimpse of Machine Learning Models and the application of models at scale using clustering, classification, regression and reinforcement learning with fun examples. Hands-on examples will be presented to understand the power of problem solving with Machine Learning and Advanced architectures, software installation, and configuration.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Errata
      3. Piracy
      4. Questions
  2. Introduction - Machine Learning and Statistical Science
    1. Machine learning in the bigger picture
      1. Types of machine learning
        1. Grades of supervision
        2. Supervised learning strategies - regression versus classification
        3. Unsupervised problem solving–clustering
    2. Tools of the trade–programming language and libraries
      1. The Python language
        1. The NumPy library
        2. The matplotlib library
          1. What's matplotlib?
        3. Pandas
        4. SciPy
        5. Jupyter notebook
    3. Basic mathematical concepts
      1. Statistics - the basic pillar of modeling uncertainty
        1. Descriptive statistics - main operations
          1. Mean
          2. Variance
          3. Standard deviation
      2. Probability and random variables
        1. Events
          1. Probability
          2. Random variables and distributions
        2. Useful probability distributions
          1. Bernoulli distributions
          2. Uniform distribution
          3. Normal distribution
          4. Logistic distribution
      3. Statistical measures for probability functions
        1. Skewness
        2. Kurtosis
      4. Differential calculus elements
      5. Preliminary knowledge
        1. In search of changes–derivatives
          1. Sliding on the slope
        2. Chain rule
          1. Partial derivatives
    4. Summary
  3. The Learning Process
    1. Understanding the problem
    2. Dataset definition and retrieval
      1. The ETL process
      2. Loading datasets and doing exploratory analysis with SciPy and pandas
      3. Working interactively with IPython
      4. Working on 2D data
    3. Feature engineering
      1. Imputation of missing data
      2. One hot encoding
    4. Dataset preprocessing
      1. Normalization and feature scaling
        1. Normalization or standardization
    5. Model definition
      1. Asking ourselves the right questions
    6. Loss function definition
    7. Model fitting and evaluation
      1. Dataset partitioning
        1. Common training terms –  iteration, batch, and epoch
        2. Types of training – online and batch processing
        3. Parameter initialization
    8. Model implementation and results interpretation
      1. Regression metrics
        1. Mean absolute error
        2. Median absolute error
        3. Mean squared error
      2. Classification metrics
        1. Accuracy
        2. Precision score, recall, and F-measure
        3. Confusion matrix
      3. Clustering quality measurements
        1. Silhouette coefficient
        2. Homogeneity, completeness, and V-measure
    9. Summary
    10. References
  4. Clustering
    1. Grouping as a human activity
    2. Automating the clustering process
    3. Finding a common center - K-means
      1. Pros and cons of K-means
      2. K-means algorithm breakdown
      3. K-means implementations
    4. Nearest neighbors
      1. Mechanics of K-NN
        1. Pros and cons of K-NN
    5. K-NN sample implementation
      1. Going beyond the basics
        1. The Elbow method
    6. Summary
    7. References
  5. Linear and Logistic Regression
    1. Regression analysis
      1. Applications of regression
        1. Quantitative versus qualitative variables
    2. Linear regression
      1. Determination of the cost function
        1. The many ways of minimizing errors
      2. Analytical approach
        1. Pros and cons of the analytical approach
      3. Covariance/correlation method
        1. Covariance
        2. Correlation
      4. Searching for the slope and intercept with covariance and correlation
      5. Gradient descent
        1. Some intuitive background
        2. The gradient descent loop
          1. Formalizing our concepts
      6. Expressing recursion as a process
        1. Going practical – new tools for new methods
        2. Useful diagrams for variable explorations – pairplot
        3. Correlation plot
    3. Data exploration and linear regression in practice
      1. The Iris dataset
        1. Getting an intuitive idea with Seaborn pairplot
        2. Creating the prediction function
        3. Defining the error function
        4. Correlation fit
        5. Polynomial regression and an introduction to underfitting and overfitting
      2. Linear regression with gradient descent in practice
    4. Logistic regression
      1. Problem domain of linear regression and logistic regression
        1. Logistic function predecessor – the logit functions
        2. Link function
      2. Logit function
        1. Logit function properties
        2. The importance of the logit inverse
        3. The sigmoid or logistic function
        4. Properties of the logistic function
        5. Multiclass application – softmax regression
      3. Practical example – cardiac disease modeling with logistic regression
        1. The CHDAGE dataset
        2. Dataset format
    5. Summary
    6. References
  6. Neural Networks
    1. History of neural models
      1. The perceptron model
      2. Improving our predictions – the ADALINE algorithm
      3. Similarities and differences between a perceptron and ADALINE
        1. Limitations of early models
      4. Single and multilayer perceptrons
        1. MLP origins
        2. The feedforward mechanism
        3. The chosen optimization algorithm – backpropagation
          1. Types of problem to be tackled
    2. Implementing a simple function with a single-layer perceptron
      1. Defining and graphing transfer function types
      2. Representing and understanding the transfer functions
      3. Sigmoid or logistic function
      4. Playing with the sigmoid
      5. Rectified linear unit or ReLU
      6. Linear transfer function
      7. Defining loss functions for neural networks
        1. L1 versus L2 properties
    3. Summary
    4. References
  7. Convolutional Neural Networks
    1. Origin of convolutional neural networks
      1. Getting started with convolution
        1. Continuous convolution
        2. Discrete convolution
      2. Kernels and convolutions
        1. Stride and padding
      3. Implementing the 2D discrete convolution operation in an example
      4. Subsampling operation (pooling)
      5. Improving efficiency with the dropout operation
        1. Advantages of the dropout layers
    2. Deep neural networks
      1. Deep convolutional network architectures through time
        1. Lenet 5
        2. Alexnet
        3. The VGG model
        4. GoogLenet and the Inception model
          1. Batch-normalized inception V2 and V3
        5. Residual Networks (ResNet)
      2. Types of problem solved by deep layers of CNNs
        1. Classification
        2. Detection
        3. Segmentation
    3. Deploying a deep neural network with Keras
    4. Exploring a convolutional model with Quiver
      1. Exploring a convolutional network with Quiver
      2. Implementing transfer learning
    5. References
    6. Summary
  8. Recurrent Neural Networks
    1. Solving problems with order — RNNs
      1. RNN definition
        1. Types of sequence to be modeled
      2. Development of RNN
        1. Training method — backpropagation through time
        2. Main problems of the traditional RNNs — exploding and vanishing gradients
    2. LSTM
      1. The gate and multiplier operation
      2. Part 1 — set values to forget (input gate)
      3. Part 2 — set values to keep
      4. Part 3 — apply changes to cell
      5. Part 4 — output filtered cell state
    3. Univariate time series prediction with energy consumption data
      1. Dataset description and loading
        1. Dataset preprocessing
    4. Summary
    5. References
  9. Recent Models and Developments
    1. GANs
      1. Types of GAN applications
        1. Discriminative and generative models
    2. Reinforcement learning
      1. Markov decision process
        1. Decision elements
      2. Optimizing the Markov process
    3. Basic RL techniques: Q-learning
    4. References
    5. Summary
  10. Software Installation and Configuration
    1. Linux installation
      1. Initial distribution requirements
      2. Installing Anaconda on Linux
      3. pip Linux installation method
        1. Installing the Python 3 interpreter
        2. Installing pip
        3. Installing necessary libraries
    2. macOS X environment installation
      1. Anaconda installation
      2. Installing pip
        1. Installing remaining libraries via pip
    3. Windows installation
      1. Anaconda Windows installation
    4. Summary