xix
Introduction
If you are holding this book, I have to assume that you are a .NET developer interested in machine learning.
You are probably comfortable with writing applications in C#, most likely line-of-business applications.
Maybe you have encountered F# before, maybe not. And you are very probably curious about machine
learning. The topic is getting more press every day, as it has a strong connection to software engineering, but
it also uses unfamiliar methods and seemingly abstract mathematical concepts. In short, machine learning
looks like an interesting topic, and a useful skill to learn, but it’s difficult to figure out where to start.
This book is intended as an introduction to machine learning for developers. My main goal in writing
it was to make the topic accessible to a reader who is comfortable writing code, and is not a mathematician.
A taste for mathematics certainly doesn’t hurt, but this book is about learning some of the core concepts
through code by using practical examples that illustrate how and why things work.
But first, what is machine learning? Machine learning is the art of writing computer programs that get
better at performing a task as more data becomes available, without requiring you, the developer, to change
the code.
This is a fairly broad definition, which reflects the fact that machine learning applies to a very broad
range of domains. However, some specific aspects of that definition are worth pointing out more closely.
Machine learning is about writing programs—code that runs in production and performs a task—which
makes it different from statistics, for instance. Machine learning is a cross-disciplinary area, and is a topic
relevant to both the mathematically-inclined researcher and the software engineer.
The other interesting piece in that definition is data. Machine learning is about solving practical
problems using the data you have available. Working with data is a key part of machine learning;
understanding your data and learning how to extract useful information from it are quite often more
important than the specific algorithm you will use. For that reason, we will approach machine learning
starting with data. Each chapter will begin with a real dataset, with all its real-world imperfections and
surprises, and a specific problem we want to address. And, starting from there, we will build a solution to the
problem from the ground up, introducing ideas as we need them, in context. As we do so, we will create a
foundation that will help you understand how different ideas work together, and will make it easy later on to
productively use libraries or frameworks, if you need them.
Our exploration will start in the familiar grounds of C# and Visual Studio, but as we progress we will
introduce F#, a .NET language that is particularly suited for machine learning problems. Just like machine
learning, programming in a functional style can be intimidating at first. However, once you get the hang of it,
F# is both simple and extremely productive. If you are a complete F# beginner, this book will walk you through
what you need to know about the language, and you will learn how to use it productively on real-world,
interesting problems.
Along the way, we will explore a whole range of diverse problems, which will give you a sense for the
many places and perhaps unexpected ways that machine learning can make your applications better. We
will explore image recognition, spam filters, and a self-learning game, and much more. And, as we take that
journey together, you will see that machine learning is not all that complicated, and that fairly simple models
can produce surprisingly good results. And, last but not least, you will see that machine learning is a lot of
fun! So, without further ado, let’s start hacking on our first machine learning problem.
www.it-ebooks.info