Python for Probability, Statistics, and Machine Learning

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Using a novel integration of mathematics and Python codes, this book illustrates the fundamental concepts that link probability, statistics, and machine learning, so that the reader can not only employ statistical and machine learning models using modern Python modules, but also understand their relative strengths and weaknesses. To clearly connect theoretical concepts to practical implementations, the author provides many worked-out examples along with "Programming Tips" that encourage the reader to write quality Python code. The entire text, including all the figures and numerical results, is reproducible using the Python codes provided, thus enabling readers to follow along by experimenting with the same code on their own computers.

 Modern Python modules like Pandas, Sympy, Scikit-learn, Statsmodels, Scipy, Xarray, Tensorflow, and Keras are used to implement and visualize important machine learning concepts like the bias/variance trade-off, cross-validation, interpretability, and regularization. Many abstract mathematical ideas, such as modes of convergence in probability, are explained and illustrated with concrete numerical examples.  This book is suitable for anyone with undergraduate-level experience with probability, statistics, or machine learning and with rudimentary knowledge of Python programming.

Author(s): José Unpingco
Edition: 3
Publisher: Springer
Year: 2022

Language: English
Pages: 523
City: Cham

Preface to the Third Edition
Preface to the Second Edition
Preface to the First Edition
Contents
1 Getting Started with Scientific Python
1.1 Installation and Setup
1.2 Numpy
1.2.1 Numpy Arrays and Memory
1.2.2 Numpy Matrices
1.2.3 Numpy Broadcasting
1.2.4 Numpy Masked Arrays
1.2.5 Floating-Point Numbers
1.2.6 Numpy Optimizations and Prospectus
1.3 Matplotlib
1.3.1 Alternatives to Matplotlib
1.3.2 Extensions to Matplotlib
1.4 IPython
1.5 Jupyter Notebook
1.6 Scipy
1.7 Pandas
1.7.1 Series
1.7.2 Dataframe
1.8 Sympy
1.9 Xarray for High Dimensional Dataframes
1.10 Interfacing with Compiled Libraries
1.11 Integrated Development Environments
1.12 Quick Guide to Performance and Parallel Programming
1.13 Other Resources
2 Probability
2.1 Introduction
2.1.1 Understanding Probability Density
2.1.2 Random Variables
2.1.3 Continuous Random Variables
2.1.4 Transformation of Variables Beyond Calculus
2.1.5 Independent Random Variables
2.1.6 Classic Broken Rod Example
2.2 Projection Methods
2.2.1 Weighted Distance
2.3 Conditional Expectation as Projection
2.3.1 Appendix
2.4 Conditional Expectation and Mean Squared Error
2.5 Worked Examples of Conditional Expectation and Mean Square Error Optimization
2.5.1 Example
2.5.2 Example
2.5.3 Example
2.5.4 Example
2.5.5 Example
2.6 Useful Distributions
2.6.1 Normal Distribution
2.6.2 Multinomial Distribution
2.6.3 Chi-Square Distribution
2.6.4 Poisson and Exponential Distributions
2.6.5 Gamma Distribution
2.6.6 Beta Distribution
2.6.7 Dirichlet-Multinomial Distribution
2.6.8 Negative Binomial Distribution
2.6.9 Negative Multinomial Distribution
2.7 Information Entropy
2.7.1 Information Theory Concepts
2.7.2 Properties of Information Entropy
2.7.3 Kullback-Leibler Divergence
2.7.4 Conditional Entropy and Mutual Information
2.7.5 Cross-Entropy as Maximum Likelihood
2.8 Moment Generating Functions
2.9 Monte Carlo Sampling Methods
2.9.1 Inverse CDF Method for Discrete Variables
2.9.2 Inverse CDF Method for Continuous Variables
2.9.3 Rejection Method
2.10 Sampling Importance Resampling
2.11 Useful Inequalities
2.11.1 Markov's Inequality
2.11.2 Chebyshev's Inequality
2.11.3 Hoeffding's Inequality
2.11.4 Jensen's Inequality
3 Statistics
3.1 Introduction
3.2 Python Modules for Statistics
3.2.1 Scipy Statistics Module
3.2.2 Sympy Statistics Module
3.2.3 Other Python Modules for Statistics
3.3 Types of Convergence
3.3.1 Almost Sure Convergence
3.3.2 Convergence in Probability
3.3.3 Convergence in Distribution
3.3.4 Limit Theorems
3.4 Estimation Using Maximum Likelihood
3.4.1 Setting Up the Coin Flipping Experiment
3.4.2 Delta Method
3.5 Hypothesis Testing and P-Values
3.5.1 Back to the Coin Flipping Example
3.5.2 Receiver Operating Characteristic
3.5.3 P-Values
3.5.4 Test Statistics
3.5.5 Testing Multiple Hypotheses
3.5.6 Fisher Exact Test
3.5.7 Contingency Table Protocols
3.6 Confidence Intervals
3.7 Sufficient Statistics
3.8 Linear Regression
3.8.1 Extensions to Multiple Covariates
3.9 Maximum A Posteriori
3.10 Robust Statistics
3.11 Bootstrapping
3.11.1 Parametric Bootstrap
3.12 Gauss-Markov
3.13 Nonparametric Methods
3.13.1 Kernel Density Estimation
3.13.2 Kernel Smoothing
3.13.3 Nonparametric Regression Estimators
3.13.4 Nearest Neighbors Regression
3.13.5 Kernel Regression
3.13.6 Curse of Dimensionality
3.13.7 Nonparametric Tests
3.14 Survival Analysis
3.14.1 Survival Curves
3.14.2 Censoring and Truncation
3.14.3 Hazard Functions and Their Properties
3.14.4 Expectations
3.14.5 Parametric Regression Models
3.14.6 Cox Proportional Hazards Model
3.15 Expectation Maximization
3.16 Survey Sampling
3.16.1 Unequal Sampling with Replacement for Weighted Totals
3.16.2 Unequal Sampling for Unweighted Totals
3.16.3 Unequal Sampling Without Replacement
3.16.4 Probability Proportional to Size (PPS) Cluster Sampling
3.16.5 Stratified Random Sampling
3.17 Log-linear Models
3.17.1 Poisson and Multinomial Models
3.17.2 Log-linear Models
3.17.3 I JK Log-linear Models
3.17.4 Iterative Proportional Fitting
3.17.5 Hierarchical Models
3.17.6 Deviance
3.17.7 Degrees of Freedom
3.17.8 Graphical Models
3.17.9 Model Selection
3.17.10 Table Raking
3.18 Missing Data
3.18.1 Multiple Imputation
3.18.2 Canonical Example for Multiple Imputation
3.18.3 Worked Example for Multiple Imputation
3.18.4 Multivariate Imputation by Chained Equations (MICE)
3.18.5 Diagnostics
4 Machine Learning
4.1 Introduction
4.2 Python Machine Learning Modules
4.3 Theory of Learning
4.3.1 Introduction to Theory of Machine Learning
4.3.2 Theory of Generalization
4.3.3 Worked Example for Generalization/Approximation Complexity
4.3.4 Cross-Validation
4.3.5 Bias and Variance
4.3.6 Learning Noise
4.4 Decision Trees
4.4.1 Random Forests
4.4.2 Understanding Boosting Trees
4.5 Logistic Regression
4.6 Generalized Linear Models
4.7 Regularization
4.7.1 Ridge Regression
4.7.2 Lasso Regression
4.8 Support Vector Machines
4.8.1 Kernel Tricks
4.9 Dimensionality Reduction
4.9.1 Generalized PCA
4.9.2 Independent Component Analysis
4.10 Clustering
4.11 Ensemble Methods
4.11.1 Bagging
4.11.2 Boosting
4.12 Deep Learning
4.12.1 Understanding Gradient Descent
4.12.2 Image Processing Using ConvolutionalNeural Networks
4.13 Interpretability
Notation
References
Index