Book Image

Machine Learning Algorithms

Book Image

Machine Learning Algorithms

Overview of this book

In this book, you will learn all the important machine learning algorithms that are commonly used in the field of data science. These algorithms can be used for supervised as well as unsupervised learning, reinforcement learning, and semi-supervised learning. The algorithms that are covered in this book are linear regression, logistic regression, SVM, naïve Bayes, k-means, random forest, TensorFlow and feature engineering. In this book, you will how to use these algorithms to resolve your problems, and how they work. This book will also introduce you to natural language processing and recommendation systems, which help you to run multiple algorithms simultaneously. On completion of the book, you will know how to pick the right machine learning algorithm for clustering, classification, or regression for your problem
Table of Contents (22 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

A quick glimpse inside Keras


Keras (https://keras.io) is a high-level deep learning framework that works seamlessly with low-level backends like TensorFlow, Theano or CNTK. In Keras a model is like a sequence of layers where each output is fed into the following computational block until the final layer is reached. The generic structure of a model is:

from keras.models import Sequential

>>> model = Sequential()

>>> model.add(...)
>>> model.add(...)
...
>>> model.add(...)

The class Sequential defines a generic empty model, that already implements all the methods needed to add layers, compile the model according to the underlying framework, to fit and evaluate the model and to predict the output given an input. All the most common layers are already implemented, including:

  • Dense, Dropout and Flattening layers
  • Convolutional (1D, 2D and 3D) layers
  • Pooling layers
  • Zero padding layers
  • RNN layers

A model can be compiled using several loss functions (like MSE or cross...