Table Of ContentAmeet Joshi
Machine Learning
and Artifi cial
Intelligence
2nd Edition
Machine Learning and Artificial Intelligence
Ameet V. Joshi
Machine Learning and
Artificial Intelligence
Second Edition
AmeetV.Joshi
Microsoft(UnitedStates)
Redmond,WA,USA
ISBN978-3-031-12281-1 ISBN978-3-031-12282-8 (eBook)
https://doi.org/10.1007/978-3-031-12282-8
1stedition:©SpringerNatureSwitzerlandAG2020
2ndedition:©TheEditor(s)(ifapplicable)andTheAuthor(s),underexclusivelicensetoSpringerNature
SwitzerlandAG2023
Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whether
thewholeorpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuse
ofillustrations,recitation,broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,and
transmissionorinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilar
ordissimilarmethodologynowknownorhereafterdeveloped.
Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication
doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant
protectivelawsandregulationsandthereforefreeforgeneraluse.
Thepublisher,theauthors,andtheeditorsaresafetoassumethattheadviceandinformationinthisbook
arebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor
theeditorsgiveawarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforany
errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional
claimsinpublishedmapsandinstitutionalaffiliations.
ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG
Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland
Toeveryonewhobelievesinhuman
intelligencetobematureenoughtocoexist
withmachineintelligenceandbebenefitted
andentertainedbyit...
Preface to the Second Edition
OneofthegreatestphysicistsofalltimeandNobelLaureateDr.RichardFeynman
was once asked by his peer to explain a property of Fermi Dirac statistics, which
wasthenaveryrecentdiscovery.Feynmanquicklysaid,
NotonlyIwillexplainittoyou,butIwillpreparealectureonitforfreshmanlevel.
However,quiteunusually,afterfewdays,hecamebackandadmitted,
Icouldnotdoit.Ijustcouldnotreducetheexplanationtofreshmanlevel.Thatmeanswe
reallydon’tunderstandit.
It was quite a bold remark coming from even Dr. Feynman. However, apart from
thetopicofFermiDiracstatisticsitself,italludestoaverydeepthoughtaboutour
understandingofthingsingeneral.Freshmanlevelhereessentiallymeantsomething
thatcanbederiveddirectlyusingthefirstprinciplesinmathematicsorphysics.This
thought has always made me conscious to try and explain everything that I claim
to understand using firstprinciples, try to explain everything conceptually and not
onlyusingelaboratesetofequations.
The area of artificial intelligence and machine learning has exploded over last
decade. With the widespread popularity, the core concepts in the field have been
sometimes diluted and sometimes reinterpreted. With such exponential growth in
the area, the scope of the field has also grown in proportion. A newcomer in the
area can quickly find the topic daunting and confusing. One can always start with
searching the relevant topics on the Web, or just start with Wikipedia, but more
oftenthannoteverysingletopicopensarabbit-holewithmoreandmorenewand
unknown concepts, and one can get lost very easily. Also, most of the concepts
inmachinelearningaredeeplyrootedinmathematicsandstatistics.Withoutsolid
background in theoretical mathematics and statistics, the sophisticated derivations
of the theorems and lemmas can make one feel confused and disinterested in the
area.
I have made an attempt here to introduce most fundamental topics in machine
learning and their applications to build artificially intelligent solutions with an
intuitive and conceptual approach. There would be some mathematical guidance
vii
viii PrefacetotheSecondEdition
usedfromtimetotime,withoutwhichtheconceptswouldnotbesufficientlyclear,
butIhavetriedtoavoidcomplexderivationsandproofstomakethecontentmore
accessible to readers that are not from strong mathematical background. In the
process,asperDr.Feynman,alsomakingsureIhaveunderstoodthemmyself.As
farasgeneralmathematicalandstatisticalrequirementsgo,Iwouldsaythattypical
undergraduate level should suffice. Also, with proliferation and standardization of
the machine learning libraries in open source domain, one does not need to go
that deep into mathematical understanding of the theory to be able to implement
the state-of-the-art machine learning models leading to state-of-the-art intelligent
solutions.
Oneofthemainsourcesofconfusionthatariseswhentryingtosolveaproblem
in the given application is the choice of algorithm. Typically each algorithm
presented here has originated from some specific problem, but the algorithm is
typically not restricted to solving only that problem. However, choosing the right
algorithm for given problem is not trivial even for a doctoral fellow with strong
mathematicalbackground.Inordertoseparatethesetwoareas,Ihavedividedthese
two areas into separate parts altogether. This will make the topics much easier to
accessforthereader.
IwouldrecommendthereadertostartwithPartI,andthenchoosePartsIIorIII
dependingontheneeds.Itwillbeidealforastudenttogosequentiallythroughthe
book,whileanewcomertotheareafromprofessionalbackgroundwouldbebetter
suitedtostartwithPartIIItounderstandorfocusonthepreciseapplicationathand
andthendelveintothedetailsofthetheoryforthealgorithmsasneededinPartII.
PartsIVandVshouldfollowafterwards.Ihaveaddedsufficientreferencesbetween
thetwopartstomakethistransitionsmooth.
In my mind, unless one can see the models in action on real data that one
can see and plot, the understanding is not complete. Hence, following the details
of algorithms and applications, I have added another part to cover the basic
implementation of the models using free and open source options. Completion of
thispartwillenablethereadertotacklethereal-worldproblemsinAIwithstate-of-
the-artMLtechniques!
Redmond,WA,USA AmeetV.Joshi
March2019
Preface to the First Edition
ThefirsteditionofthebookreceivedaresoundingresponsefromthereadersandI
wasextremelythrilledtohavetheopportunitytohaveafollowupsecondeditionof
thebook.
Ihavebeencollectingfeedbackfrommultiplereadersandreviewersoverthelast
couple of years and also keeping close with the new developments happening the
field. There was certainly more content that was ready to be added to the book,
as well as some content needed edits. Also, this time Springer suggested that I
should be creating a textbook version rather than reference book version as was
thecasewithfirstedition.Thismeantmakingthecontentmoretunedforcollegiate
curriculum.ItwasachallengethatIwashappytoaccept.
So,thissecondeditionofthebookisprimarilytargetedtoserveasatextbookfor
anundergradorgraduatelevelcourseonmachinelearningandartificialintelligence.
The book is now organized into five parts including a conclusion. The core of the
bookborrowstheconceptsfromfirsteditionbutthenandaddsimplementationsto
all the algorithms as they are explained in the same chapter. This way, students
can now complete the understanding of the concepts with implementation and
applicationtorealworldproblems.
Part I of the book sets the stage for learning the vast array of machine learning
techniquesandtheirapplicationswithfoundationaryconcepts,andimplementation
platformdetails.
Part II of the book dives deep into the theory of machine learning techniques
coupledwithimplementingthemusingcloudbasedopensourceresources.
Part III Integrates all these concepts to study how to build end to end machine
learningpipelinesandperformancemeasurementoftheimplementedMLmodels.
Part IV focuses on artificial intelligence, which is essentially application of all
thetechniqueslearnedsofartocreateintelligentexperiencesinpracticalsituations.
ix
x PrefacetotheFirstEdition
I wish good luck to all the student embarking on the awesome journey to learn
a true twentieth century science of machine learning and its application to create
artificialintelligence.Hopethatthisbookwillgivethemasolidfoundationtobuild
theirfuturecareers.
Redmond,WA,USA AmeetV.Joshi
March2022
Acknowledgments
Iwouldliketousethisopportunitytoacknowledgethepeoplewhomadesignificant
contributions towards creation of the second edition of this book. It was certainly
a daunting task to update on the first edition of the book that already was a huge
success.
However,continuous supportandencouragement frommywife,Meghana, and
sons,DhroovandSushaan,reallyhelpedmecontinuewiththeeffortsandultimately
completethebook.IwouldalsoliketothankmymotherMadhuri,fatherVijay,and
brotherMandarfortheircontinuousencouragementandsupport.
IwouldliketothankMaryJamesofSpringerfortheencouragementandsupport
asIworkedthroughthecompletionofthebook.IwouldalsoliketothankAmrita,
Zoe,Brian,andthewholeteamofSpringerfortheirtimelyhelpwithupdates.
Thepresentbookisafurtheranceoftheeffortsfromthepublicationofthefirst
edition towards unification of the disparate areas in the field of machine learning
to produce artificially intelligent experiences. The book essentially stands on the
pillarsofthisknowledgethatwascreatedbythenumerousextraordinaryscientists
and brilliant mathematicians over several decades. So, I would like to thank them
allaswell.
Last but not the least, I would like to thank all the readers who provided me
with valuable feedback and thousands of readers who used this book towards
understanding the concepts in this area. Their critic and encouragement certainly
helpedmeimproveonthefirsteditionofthisbook.
xi