Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
F# for Machine Learning Essentials

You're reading from   F# for Machine Learning Essentials Get up and running with machine learning with F# in a fun and functional way

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781783989348
Length 194 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Sudipta Mukherjee Sudipta Mukherjee
Author Profile Icon Sudipta Mukherjee
Sudipta Mukherjee
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introduction to Machine Learning FREE CHAPTER 2. Linear Regression 3. Classification Techniques 4. Information Retrieval 5. Collaborative Filtering 6. Sentiment Analysis 7. Anomaly Detection Index

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "For example, able has a positive polarity of 0.125 and unable has a negative polarity of 0.75."

A block of code is set as follows:

let calculateSO (docs:string list list)(words:string list)=
    let mutable res  = 0.0
    for i in 0 .. docs.Length - 1 do
        for j in 0 .. docs.[i].Length - 1    do
            for pw in words do
                 res <- res + pmi docs docs.[i].[j] pw
    res

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

Calling this function is simple as shown below.
//The above rating matrix is represented as (float list)list in F#
let ratings = [[4.;0.;5.;5.];[4.;2.;1.;0.];[3.;0.;2.;4.];[4.;4.;0.;0.];[2.;1.;3.;5.]]
//Finding the predicted rating for user 1 for item 2
let p12 = Predictu  ratings  0 1

Any command-line input or output is written as follows:

if d1 = 0.0 || d2 = 0.0 then 0.0 else num  / ((sqrt d1) * (sqrt d2 ))

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Navigate to user id and then on item id."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image