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
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Pointwise Mutual Information


PMI between two words is calculated using the following formula:

represent the number of occurrences of the word word in the entire document collection. The original article that proposed this idea used the number of articles returned for the search word word from the AltaVista search engine. But you can safely use a probability (the number of documents in which the word word appeared divided by the total number of documents). The & operator in refers to the number of documents containing both words word1 and word2 divided by the total number of documents.

The following function finds the probability of the word in a document collection represented by list:

The following function finds the probability of the words w1 and w2 in a document collection represented by list:

The following function calculates the PMI between w1 and w2: