A Handbook of Mathematical Models with Python - Dr. Ranja Sarkar - E-Book

A Handbook of Mathematical Models with Python E-Book

Dr. Ranja Sarkar

0,0
35,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Mathematical modeling is the art of transforming a business problem into a well-defined mathematical formulation. Its emphasis on interpretability is particularly crucial when deploying a model to support high-stake decisions in sensitive sectors like pharmaceuticals and healthcare.
Through this book, you’ll gain a firm grasp of the foundational mathematics underpinning various machine learning algorithms. Equipped with this knowledge, you can modify algorithms to suit your business problem. Starting with the basic theory and concepts of mathematical modeling, you’ll explore an array of mathematical tools that will empower you to extract insights and understand the data better, which in turn will aid in making optimal, data-driven decisions. The book allows you to explore mathematical optimization and its wide range of applications, and concludes by highlighting the synergetic value derived from blending mathematical models with machine learning.
Ultimately, you’ll be able to apply everything you’ve learned to choose the most fitting methodologies for the business problems you encounter.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 151

Veröffentlichungsjahr: 2023

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



A Handbook of Mathematical Models with Python

Elevate your machine learning projects with NetworkX, PuLP, and linalg

Dr. Ranja Sarkar

BIRMINGHAM—MUMBAI

A Handbook of Mathematical Models with Python

Copyright © 2023 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Publishing Product Manager: Tejashwini R

Content Development Editor: Joseph Sunil

Technical Editor: Devanshi Ayare

Copy Editor: Safis Editing

Project Coordinator: Farheen Fathima

Proofreader: Safis Editing

Indexer: Rekha Nair

Production Designer: Jyoti Kadam

Marketing Coordinator: Vinishka Kalra

First published: August 2023

Production reference: 1180823

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-80461-670-3

www.packtpub.com

Dedicated to my Maa, Rina Sarkar, and my Baba, Nilambar Sarkar. I owe everything to my parents.

I would like to thank Souvik and Aarushi for being my support system.

– Ranja Sarkar

Contributors

About the author

Dr. Ranja Sarkar is a delivery manager (data science consulting) at TheMathCompany. She is a scientist with a focus on the intersection of data science and technology, working on a variety of projects in sectors ranging from manufacturing to healthcare to retail. Prior to this, Ranja worked as a data scientist at Shell plc, the most diversified global group of energy and petrochemical companies. Ranja has a decade of experience in academic scientific research encompassing physics, biophysics, statistical physics, and mathematics with publications in peer-reviewed internationally acclaimed journals. She has also worked at Deloitte offices in the US as a consultant for a year.

I want to thank my professors, mentors, colleagues, and friends for their continued support and encouragement.

To all the Packt editors, the managers who motivated me to write this content, and the entire team for keeping me on my toes throughout the process of writing the book and seeing it through to the end.

About the reviewer

Indraneel Chakraborty is a developer, specializing in creating data-driven workflows and high-quality web applications on cloud platforms. With a background in Bioinformatics and Biotechnology, he's skilled in academic research involving clinical trials registry data, and has published multiple research articles in reputed journals. In the biomedical software industry, he offers scientific and technical solutions while also developing highly scalable cloud infrastructure which includes automating and expediting large-scale processes.He is proficient in programming languages including Python and R, and has hands-on experience with Large Language Models (LLMs) and prompt engineering techniques. He is also an active contributor to open source projects and volunteers as a maintainer for open source courses that teach coding and data science skills to professionals and researchers worldwide. He also volunteers reviewing technical content. Indraneel's enthusiasm lies in exploring new technology stacks, honing his cloud engineering skills, and advancing his expertise in data science.

Table of Contents

Preface

Part 1: Mathematical Modeling

1

Introduction to Mathematical Modeling

Mathematical optimization

Understanding the problem

Formulation of the problem

Signal processing

Understanding the problem

Formulation of the problem

Control theory

Understanding the problem

Formulation of the problem

Summary

2

Machine Learning vis-à-vis Mathematical Modeling

ML as mathematical optimization

Example 1 – regression

Example 2 – neural network

ML – a predictive tool

E-commerce

Sales and marketing

Cybersecurity

Mathematical modeling – a prescriptive tool

Finance

Retail

Energy

Digital advertising

Summary

Part 2:Mathematical Tools

3

Principal Component Analysis

Linear algebra for PCA

Covariance matrix – eigenvalues and eigenvectors

Number of PCs – how to select for a dataset

Feature extraction methods

LDA – the difference from PCA

Applications of PCA

Noise reduction

Anomaly detection

Summary

4

Gradient Descent

Gradient descent variants

Application of gradient descent

Mini-batch gradient descent and stochastic gradient descent

Gradient descent optimizers

Momentum

Adagrad

RMSprop

Adam

Summary

5

Support Vector Machine

Support vectors in SVM

Kernels for SVM

Implementation of SVM

Summary

6

Graph Theory

Types of graphs

Undirected graphs

Directed graphs

Weighted graphs

Optimization use case

Optimization problem

Optimized solution

Graph neural networks

Summary

7

Kalman Filter

Computation of measurements

Filtration of measurements

Implementation of the Kalman filter

Summary

8

Markov Chain

Discrete-time Markov chain

Transition probability

Application of the Markov chain

Markov Chain Monte Carlo

Gibbs sampling algorithm

Metropolis-Hastings algorithm

Illustration of MCMC algorithms

Summary

Part 3:Mathematical Optimization

9

Exploring Optimization Techniques

Optimizing machine learning models

Random search

Grid search

Bayesian optimization

Optimization in operations research

Evolutionary optimization

Summary

10

Optimization Techniques for Machine Learning

General optimization algorithms

First-order algorithms

Second-order algorithms

Complex optimization algorithms

Differentiability of objective functions

Direct and stochastic algorithms

Summary

Epilogue

Index

Other Books You May Enjoy

Part 1:Mathematical Modeling

In this part, you will get to know the theory behind mathematical modeling. You will be introduced to the concepts of a mathematical model and how they are relevant in solving a business problem. A mathematical model relies heavily on domain knowledge, the objective of the business case formulated into a mathematical problem, and constraints in the context, while a machine learning (statistical) model relies on data. Mathematical modeling is complementary to machine learning; for some use cases, one is enough, whereas a few others need a blend of the two.

This part has the following chapters:

Chapter 1, Introduction to Mathematical ModelingChapter 2, Machine Learning vis-à-vis Mathematical Modeling

1

Introduction to Mathematical Modeling

There is a great deal of interesting work happening in data sciences, especially in the realms of Machine Learning (ML) and Deep Learning (DL), and they are popular for good reason. However, the more tried and tested old-timer, mathematical modeling, is not much talked about. Mathematical modeling methods are no less relevant and are complementary to ML. To create successful data products that solve real business problems, we must often deploy the whole breadth of available mathematical tools, far beyond ML.

A model is a simplified representation of a real system and captures the essence of the system. A mathematical model uses variables, operators, functions, equations, and equalities. Under the hood of mathematical models, there are first-principle models based on physical laws, stochastic models based on distributions, averages, and empirical models based on patterns or historical data. Based on the particular type of modeling, qualitative or quantitative recommendations can be made for the system under consideration. A mathematical model facilitates design and prototyping and substantiates decisions. To formulate a mathematical model, one needs the input and output, the constants and variables, the domain and boundary, or initial conditions and constraints. The solution can be analytic or numerical; in either case, it determines the typical behavior and critical parameters of the system, trends, dependency, and operating regimes. Systems can be deterministic, wherein we know the cause-effect relationship, or they may be stochastic, involving probability distributions.

A few mature tools in mathematical modeling are in the following areas:

Mathematical optimizationSignal processingControl theory

We will explore these mathematical modeling approaches in the following sections. A narrow focus on ML misses out on many relevant features of pure mathematical optimization in many use cases. Successful solutions across disparate domains blend the new world of ML with classical mathematical modeling techniques. For example, one can combine state-space modeling methods with ML to infer unobserved parameters of systems in a parameter estimation problem.

Mathematical optimization

A branch of applied mathematics is mathematical optimization, popularly known as mathematical programming. It finds applications in fields such as manufacturing, inventory control, scheduling, networks, economics, engineering, and financial portfolio allocation. Almost any classification, regression, or clustering problem can be cast as an optimization problem. Some problems are static, while some are dynamic, wherein the values of system variables change over time.

Understanding the problem

Mathematical optimization is basically choosing inputs from a set of allowed options to obtain the optimized or best possible output in a given problem. There are variables, which are essentially the decisions we have to make; constraints, which are the business rules we have to adhere to; and objectives, which are the business goals we are aiming to achieve by representing the real-world business problem as an optimization problem. For example, a hospital’s business problem is equipment and facility capacity planning. Medical equipment including beds and testing kits comprise the decision variables in this case; constraints are conventional and crisis capacity levels and regulations; and finally, the objective is to maximize resource utilization and service performance and minimize operating costs at the same time.

The most basic optimization problem consists of an objective function or cost function, which is the output value we try to optimize, in other words, maximize or minimize. The inputs are variables that can be controlled. Variables can be either discrete or continuous. The scale of a problem is pretty much determined by the dimensionality, that is, the number of scalar variables (also called decision variables) on which the search is performed. Constraints or equations place limits on how big or small some variables can get. Some problems have constraints, which can be equality or inequality constraints, while some problems do not have them at all, which implies the unbounded optimization of the function.

A linear