PDF (Ebook) Data Science and Machine Learning: Mathematical and Statistical Methods (Chapman & Hall/Crc Machine Learning & Pattern Recognition) by Dirk P. Kroese, Zdravko Botev, Thomas Taimre, Radislav Vaisman ISBN 9781138492530, 1138492531 download
PDF (Ebook) Data Science and Machine Learning: Mathematical and Statistical Methods (Chapman & Hall/Crc Machine Learning & Pattern Recognition) by Dirk P. Kroese, Zdravko Botev, Thomas Taimre, Radislav Vaisman ISBN 9781138492530, 1138492531 download
com
DOWLOAD EBOOK
ebooknice.com
ebooknice.com
ebooknice.com
ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT
II Success) by Peterson's ISBN 9780768906677, 0768906679
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
ebooknice.com
ebooknice.com
ebooknice.com
ebooknice.com
ebooknice.com
Data Science and Machine Learning
Mathematical and Statistical Methods
Chapman & Hall/CRC Machine Learning & Pattern
Recognition
Bayesian Programming
Pierre Bessiere, Emmanuel Mazer, Juan Manuel Ahuactzin, Kamel
Mekhnacha
Dirk P. Kroese
Zdravko I. Botev
Thomas Taimre
Radislav Vaisman
Front cover image reproduced with permission from J. A. Kroese.
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources.
Reasonable efforts have been made to publish reliable data and information, but the author
and publisher cannot assume responsibility for the validity of all materials or the
consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if
permission to publish in this form has not been obtained. If any copyright material has not
been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted,
reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other
means, now known or hereafter invented, including photocopying, microfilming, and
recording, or in any information storage or retrieval system, without written permission
from the publishers.
For permission to photocopy or use material electronically from this work, please access
www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance
Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a
not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of
payment has been arranged.
To Valerie
— RV
CONTENTS
Preface
Notation
2 Statistical Learning
2.1 Introduction
2.2 Supervised and Unsupervised Learning
2.3 Training and Test Loss
2.4 Tradeoffs in Statistical Learning
2.5 Estimating Risk
2.5.1 In-Sample Risk
2.5.2 Cross-Validation
2.6 Modeling Data
2.7 Multivariate Normal Models
2.8 Normal Linear Models
2.9 Bayesian Learning
Exercises
4 Unsupervised Learning
4.1 Introduction
4.2 Risk and Loss in Unsupervised Learning
4.3 Expectation–Maximization (EM) Algorithm
4.4 Empirical Distribution and Density Estimation
4.5 Clustering via Mixture Models
4.5.1 Mixture Models
4.5.2 EM Algorithm for Mixture Models
4.6 Clustering via Vector Quantization
4.6.1 K-Means
4.6.2 Clustering via Continuous Multiextremal Optimization
4.7 Hierarchical Clustering
4.8 Principal Component Analysis (PCA)
4.8.1 Motivation: Principal Axes of an Ellipsoid
4.8.2 PCA and Singular Value Decomposition (SVD)
Exercises
5 Regression
5.1 Introduction
5.2 Linear Regression
5.3 Analysis via Linear Models
5.3.1 Parameter Estimation
5.3.2 Model Selection and Prediction
5.3.3 Cross-Validation and Predictive Residual Sum of Squares
5.3.4 In-Sample Risk and Akaike Information Criterion
5.3.5 Categorical Features
5.3.6 Nested Models
5.3.7 Coefficient of Determination
5.4 Inference for Normal Linear Models
5.4.1 Comparing Two Normal Linear Models
5.4.2 Confidence and Prediction Intervals
5.5 Nonlinear Regression Models
5.6 Linear Models in Python
5.6.1 Modeling
5.6.2 Analysis
5.6.3 Analysis of Variance (ANOVA)
5.6.4 Confidence and Prediction Intervals
5.6.5 Model Validation
5.6.6 Variable Selection
5.7 Generalized Linear Models
Exercises
7 Classification
7.1 Introduction
7.2 Classification Metrics
7.3 Classification via Bayes’ Rule
7.4 Linear and Quadratic Discriminant Analysis
7.5 Logistic Regression and Softmax Classification
7.6 K-Nearest Neighbors Classification
7.7 Support Vector Machine
7.8 Classification with Scikit-Learn
Exercises
9 Deep Learning
9.1 Introduction
9.2 Feed-Forward Neural Networks
9.3 Back-Propagation
9.4 Methods for Training
9.4.1 Steepest Descent
9.4.2 Levenberg–Marquardt Method
9.4.3 Limited-Memory BFGS Method
9.4.4 Adaptive Gradient Methods
9.5 Examples in Python
9.5.1 Simple Polynomial Regression
9.5.2 Image Classification
Exercises
D Python Primer
D.1 Getting Started
D.2 Python Objects
D.3 Types and Operators
D.4 Functions and Methods
D.5 Modules
D.6 Flow Control
D.7 Iteration
D.8 Classes
D.9 Files
D.10 NumPy
D.10.1 Creating and Shaping Arrays
D.10.2 Slicing
D.10.3 Array Operations
D.10.4 Random Numbers
D.11 Matplotlib
D.11.1 Creating a Basic Plot
D.12 Pandas
D.12.1 Series and DataFrame
D.12.2 Manipulating Data Frames
D.12.3 Extracting Information
D.12.4 Plotting
D.13 Scikit-learn
D.13.1 Partitioning the Data
D.13.2 Standardization
D.13.3 Fitting and Prediction
D.13.4 Testing the Model
D.14 System Calls, URL Access, and Speed-Up
Bibliography
Index
PREFACE
Python code and data sets for each chapter can be downloaded from the
GitHub site: https://github.com/DSML-book
Acknowledgments
Some of the Python code for Chapters 1 and 5 was adapted from [73]. We
thank Benoit Liquet for making this available, and Lauren Jones for
translating the R code into Python.
We thank all who through their comments, feedback, and suggestions
have contributed to this book, including Qibin Duan, Luke Taylor, Rémi
Mouzayek, Harry Goodman, Bryce Stansfield, Ryan Tongs, Dillon Steyl,
Bill Rudd, Nan Ye, Christian Hirsch, Chris van der Heide, Sarat Moka,
Aapeli Vuorinen, Joshua Ross, Giang Nguyen, and the anonymous referees.
David Grubbs deserves a special accollade for his professionalism and
attention to detail in his role as Editor for this book.
The book was test-run during the 2019 Summer School of the Australian
Mathematical Sciences Institute. More than 80 bright upper-undergraduate
(Honours) students used the book for the course Mathematical Methods for
Machine Learning, taught by Zdravko Botev. We are grateful for the
valuable feedback that they provided.
Our special thanks go out to Robert Salomone, Liam Berry, Robin
Carrick, and Sam Daley, who commented in great detail on earlier versions
of the entire book and wrote and improved our Python code. Their
enthusiasm, perceptiveness, and kind assistance have been invaluable.
Of course, none of this work would have been possible without the loving
support, patience, and encouragement from our families, and we thank them
with all our hearts.
This book was financially supported by the Australian Research Council
Centre of Excellence for Mathematical & Statistical Frontiers, under grant
number CE140100049.
• Random variables are generally specified with upper case roman letters
X, Y, Z and their outcomes with lower case letters x, y, z. Random
vectors are thus denoted in upper case slanted bold font: X = [X1,…,
X ]⊤.
n
• Sets of vectors are generally written in calligraphic font, such as χ, but
the set of real numbers uses the common blackboard bold font ℝ.
Expectation and probability also use the latter font.
• Probability distributions use a sans serif font, such as Bin and Gamma.
Exceptions to this rule are the “standard” notations N and U for the
normal and uniform distributions.
∇f gradient of f
∇ 2f Hessian of f
f ∈ Cp f has continuous derivatives of order p
≈ is approximately
≃ is asymptotically
≪ is much smaller than
⊕ direct sum
⊙ elementwise product
∩ intersection
∪ union
≔,=: is defined as
a.s.
converges almost surely to
−
→
d
converges in distribution to
→
P
converges in probability to
→
Lp
converges in Lp-norm to
→
Matrix/vector notation
A⊤,x⊤ transpose of matrix A or vector x
A-1 inverse of matrix A
A+ pseudo-inverse of matrix A
A-⊤ inverse of matrix A⊤ or transpose of A-1
A≻0 matrix A is positive definite
A ≥ 0 matrix A is positive semidefinite
dim( x) dimension of vector x
det(A) determinant of matrix A
|A| absolute value of the determinant of matrix A
tr(A) trace of matrix A
Probability distributions
Ber Bernoulli
Beta beta
Bin binomial
Exp exponential
Geom geometric
Gamma gamma
F Fisher–Snedecor F
N normal or Gaussian
Pareto Pareto
Poi Poisson
t Student’s t
U uniform
This chapter describes where to find useful data sets, how to load
them into Python, and how to (re)structure the data. We also discuss
various ways in which the data can be summarized via tables and
figures. Which type of plots and numerical summaries are appropriate
depends on the type of the variable(s) in play. Readers unfamiliar with
Python are advised to read Appendix D first.
1.1 Introduction
Data comes in many shapes and forms, but can generally be thought of as
being the result of some random experiment — an experiment whose
outcome cannot be determined in advance, but whose workings are still
subject to analysis. Data from a random experiment are often stored in a
table or spreadsheet. A statistical convention is to denote variables — often
called features — as columns and the individual items (or units) as rows. It
is useful to think of three types of columns in such a spreadsheet:
FEATURES
There are many data sets available from the Internet and in software
packages. A well-known repository of data sets is the Machine Learning
Repository maintained by the University of California at Irvine (UCI),
found at https://archive.ics.uci.edu/.
These data sets are typically stored in a CSV (comma separated values)
format, which can be easily read into Python. For example, to access the
abalone data set from this website with Python, download the file to your
working directory, import the pandas package via
import pandas as pd
It is important to add header = None, as this lets Python know that the first
line of the CSV does not contain the names of the features, as it assumes so
by default. The data set was originally used to predict the age of abalone
from physical measurements, such as shell weight and diameter.
Another useful repository of over 1000 data sets from various packages
in the R programming language, collected by Vincent Arel-Bundock, can be
found at:
https://vincentarelbundock.github.io/Rdatasets/datasets.html.
For example, to read Fisher’s famous iris data set from R’s datasets
package into Python, type:
Exploring the Variety of Random
Documents with Different Content
In this he undoubtedly told the truth. For what we thought was a
spy was just a silly old soap peddler, who had gotten the idea
somehow that his dead brother had hidden a lot of money in the
stone wall of his mill. No doubt Mr. Ricks misplaced the roll of dress
patterns on the train. He’s pretty good at misplacing things! Aunt
Polly says that he would misplace his head if it wasn’t fastened to
him.
Dad says that big companies do business on the square. And Dad
knows.
We called on Mrs. Crandon the following day. And when we had told
her about our adventure she showed us her pile of soap. Twenty-
four cakes!
Scoop grinned.
“This ought to be enough soap to keep you beautiful for the next
fifty years.”
Dog-gone! I felt pretty cheap. For everybody in town knew the joke.
The woman I had seen on Miss Prindle’s porch was her out-of-town
[226]sister. And Red’s beauty was all put on with cold cream and face
powder. He had his mother fix him up to fool me.
“If the baby has warts on the inside of her stomach,” grinned Scoop,
“she’s cured for life. For Bubbles of Beauty is death on warts. If you
think I’m stringing you, ask Jerry. The soap cured the wart that Mrs.
Pederson put on the top of his head with a broom.”
“If you don’t dry up,” I waggled, “I’ll put a wart on your head.”
THE END
[227]
[Contents]
BOOKS BY LEO EDWARDS
[Contents]
Spotlight Books for Boys
[Contents]
Books for Boys by a Master of Fiction
MARK TIDD
Here is fun and action aplenty and a story that will hold
Mark’s old friends and make many new ones.
[Contents]
TALES OF ADVENTURE IN THE GREAT
NORTHWEST
Neewa, the bear cub, and Miki, the pup, separated from
their master, grow up in the wilderness until, in the end,
they find him and bring to him the girl he loves.
SWIFT LIGHTNING
[Contents]
WESTERN STORIES FOR BOYS
[Contents]
THE NANCY DREW MYSTERY STORIES
By CAROLYN KEENE
Availability
This eBook is for the use of anyone anywhere at no cost and with
almost no restrictions whatsoever. You may copy it, give it away or
re-use it under the terms of the Project Gutenberg License included
with this eBook or online at www.gutenberg.org ↗️.
Metadata
Revision History
2022-03-03 Started.
External References
Corrections
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com