34,79 €
Get up and running with machine learning with F# in a fun and functional way
If you are a C# or an F# developer who now wants to explore the area of machine learning, then this book is for you. Familiarity with theoretical concepts and notation of mathematics and statistics would be an added advantage.
The F# functional programming language enables developers to write simple code to solve complex problems. With F#, developers create consistent and predictable programs that are easier to test and reuse, simpler to parallelize, and are less prone to bugs.
If you want to learn how to use F# to build machine learning systems, then this is the book you want.
Starting with an introduction to the several categories on machine learning, you will quickly learn to implement time-tested, supervised learning algorithms. You will gradually move on to solving problems on predicting housing pricing using Regression Analysis. You will then learn to use Accord.NET to implement SVM techniques and clustering. You will also learn to build a recommender system for your e-commerce site from scratch. Finally, you will dive into advanced topics such as implementing neural network algorithms while performing sentiment analysis on your data.
This book is a fast-paced tutorial guide that uses hands-on examples to explain real-world applications of machine learning. Using practical examples, the book will explore several machine learning techniques and also describe how you can use F# to build machine learning systems.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 163
Veröffentlichungsjahr: 2016
Copyright © 2016 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, and its dealers and distributors will be held liable for any damages caused or alleged to be 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.
First published: February 2016
Production reference: 1190216
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-934-8
www.packtpub.com
Author
Sudipta Mukherjee
Reviewers
Alena Hall
David Stephens
Commissioning Editor
Ashwin Nair
Acquisition Editors
Harsha Bharwani
Larissa Pinto
Content Development Editor
Athira Laji
Technical Editor
Ryan Kochery
Copy Editor
Alpha Singh
Project Coordinator
Bijal Patel
Proofreader
Safis Editing
Indexer
Rekha Nair
Graphics
Abhinash Sahu
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Machine Learning (ML) is one of the most impactful technologies of the last 10 years, fueled by the exponential growth of electronic data about people and their interaction with the world and each other, as well as the availability of massive computing power to extract patterns from data. Applications of ML are already affecting all of us in everyday life, whether it's face recognition in modern cameras, personalized web or product searches, or even the detection of road sign patterns in modern cars. Machine learning is a set of algorithms that learn prediction programs from past data in order to use them for future predictions—whether the prediction programs are represented as decision trees, as neural networks, or via nearest-neighbor functions.
Another influential development in computer science is the invention of F#. Less than 10 years ago, functional programming was a more of an academic endeavor than a style of programming and software development used in production systems. The development of F# since 2005 changed this forever. With F#, programmers are not only able to benefit from type inference and easy parallelization of workflows, but they also get the runtime performance that they are used to from programming in other .NET languages, such as C#. I personally witnessed this transformation at Microsoft Research and saw how data-intensive applications could be written much more safely in less than 100 lines of F# code compared to thousands of lines of C# code.
A critically important ingredient of ML is data; it's the lifeblood of any ML algorithm. Parsing, cleaning, and visualizing data is the basis of any successful ML application and constitutes the majority of the time that practitioners spend in making machine learning systems work. F# proves to be the perfect bridge between data processing and analysis, with ML on one hand and the ability to invent new ML algorithms on the other hand.
In this book, Sudipta Mukherjee introduces the reader to the basics of machine learning, ranging from supervised methods, such as classification learning and regression, to unsupervised methods, such as K-means clustering. Sudipta focuses on the applied aspects of machine learning and develops all algorithms in F#, both natively as well as by integrating with .NET libraries such as WekaSharp, Accord.Net and Math.Net. He covers a wide range of algorithms for classification and regression learning and also explores more novel ML concepts, such as anomaly detection. The book is enriched with directly applicable source code examples, and the reader will enjoy learning about modern machine learning algorithms through the numerous examples provided.
Dr. Ralf Herbrich
Director of Machine Learning Science at Amazon
Sudipta Mukherjee was born in Kolkata and migrated to Bangalore. He is an electronics engineer by education and a computer engineer/scientist by profession and passion. He graduated in 2004 with a degree in electronics and communication engineering.
He has a keen interest in data structure, algorithms, text processing, natural language processing tools development, programming languages, and machine learning at large. His first book on Data Structure using C has been received quite well. Parts of the book can be read on Google Books at http://goo.gl/pttSh. The book was also translated into simplified Chinese, available from Amazon.cn at http://goo.gl/lc536. This is Sudipta's second book with Packt Publishing. His first book, .NET 4.0 Generics (http://goo.gl/MN18ce), was also received very well. During the last few years, he has been hooked to the functional programming style. His book on functional programming, Thinking in LINQ (http://goo.gl/hm0lNF), was released last year. Last year, he also gave a talk at @FuConf based on his LINQ book (https://goo.gl/umdxIX). He lives in Bangalore with his wife and son.
Sudipta can be reached via e-mail at <[email protected]> and via Twitter at @samthecoder.
First, I want to thank Dr. Don Syme (@dsyme) and everyone in the product team who brought F# to the world and made a fantastic integration with Visual Studio. I also want to thank Professor Andrew Ng (@AndrewYNg). I first learned about machine learning from his MOOC on machine learning at Coursera (https://www.coursera.org/learn/machine-learning).
This book couldn't have seen the light of day without a few people: my acquisition editor, Ms. Harsha Bharwani, who persuaded me to work on this book; and my development editor, Ms. Athira Laji, who tolerated many delays in the delivery schedule but kept the bar high and got me going. She is one of the most compassionate development editors I have ever worked with. Thank you mam! I have been fortunate to have a couple of very educated reviewers on board: Mr. David Stephens (the PM of the F# programming language) (@NumberByColors) and Ms. Alena Dzenisenka (@lenadroid). The book uses several open source frameworks and F#. So, thanks to all the people who have contributed to these projects. I also want to say a huge thank you to Dr. Ralf Herbrich (@rherbrich), the director of machine learning science at Amazon, Berlin, for kindly writing a foreword for the book.
Last but not least, I must say that I am very fortunate to have a very loving family, who always stood by me whenever I needed support. My wife, Mou, made sure that I had enough time to write the chapters. We couldn't go out on weekends. I promise to make up for all the missed family time. Thank you sweetheart! My son, Sohan, has been my inspiration. His enthusiasm makes me feel happy. Love you son. I hope when he grows up, machine learning will be more mainstream and will have become far more commonplace in the programming ecosystem than it is now. My dad, Subrata, always inspired me to learn more about mathematics. I realized how important mathematics is in programming while writing this book. My mom, Dipali, taught me mathematics in my early years and what I know today about mathematics is deeply rooted in her teachings. I love you all!
I am thankful to God for giving me the strength to dream big and fight my nightmares.
Alena Hall is an experienced Solution Architect proficient in distributed cloud programming, real-time system modeling, higher load and performance, big data analysis, data science, functional programming, and machine learning. She is a speaker at international conferences and a member of the F# Board of Trustees.
David Stephens is the program manager for Visual F# at Microsoft. He's responsible for representing the needs of F# developers within Microsoft, managing the development of new features, and evangelizing F#. Prior to joining the .NET team, David worked on tools for Apache Cordova, the F12 developer tools in Microsoft Edge, TypeScript, and .NET Native. He has a bachelor's degree in computer science and mathematics from the Raikes School of Computer Science and Management at the University of Nebraska in Lincoln, Nebraska, USA.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Machine learning (ML) is more prevalent now than ever before. Every day a lot of data is being generated. Machine learning algorithms perform heavy duty number crunching to improve our lives every day. The following image captures the major tasks that machine learning algorithms perform. These are the classes or types of problems that ML algorithms solve.
Our lives are more and more driven by the output of these ML algorithms than we care to admit. Let me walk you through the image once:
Now that you have a top-level idea of what ML algorithms can do for you, let's see why F# is the perfect fit for the implementations. Here are my reasons for using F# to implement machine learning algorithms:
Chapter 1, Introduction to Machine Learning, introduces machine learning concepts.
Chapter 2, Linear Regression, introduces and implements several linear regression models using F#.
Chapter 3, Classification Techniques, introduces classification as a formal problem and then solves some use cases using F#.
Chapter 4, Information Retrieval, provides implementations of several information retrieval distance metrics that can be useful in several situations.
Chapter 5, Collaborative Filtering, explains the workhorse algorithm for recommender systems, provides an implementation using F#, and then shows how to evaluate such a system.
Chapter 6, Sentiment Analysis, explains sentiment analysis and after positioning it as a formal problem statement, solves it using several state-of-the-art algorithms.
Chapter 7, Anomaly Detection, explains and poses the anomaly detection problem statement and then gives several algorithms and their implementation in F#.
You will need Visual Studio 2010 or above and a good internet connection because some of the plotting APIs used here rely on connectivity.
If you are a C# or F# developer who now wants to explore the area of machine learning, then this book is for you. No prior knowledge of machine learning is assumed.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.