Book Image

F# for Machine Learning Essentials

By : Sudipta Mukherjee
Book Image

F# for Machine Learning Essentials

By: Sudipta Mukherjee

Overview of this book

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.
Table of Contents (16 chapters)
F# for Machine Learning Essentials
About the Author
About the Reviewers

Ridge regression

Ridge regression is a technique to block the cases where X'X becomes singular. I is an identity matrix where all the elements in the diagonal are 1 and all the other elements are zero. is a user-defined scalar value and it is used to minimize the prediction error.

The following code snippet uses the house price example to find the theta using ridge regression model:

The price is a vector holding the price of all the houses.

  • is known as the Shrinkage Parameter
  • controls the size of the coefficients of theta
  • controls the amount of regularization

To obtain the value of , you have to break the training data into several sets and run the algorithm several times with several values of , and then find the one that is most sensible and reduces error the most. There are some techniques to find the value of using SVD but it's not proven to work all the time.