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

Chi-squared statistic to determine anomalies


Ye and Chen used a statistic to determine anomalies in the operating system call data. The training phase assumes that the normal data has a multivariate normal distribution. The value of the statistic is determined as:

Where denotes the observed value of the ith variable, is the expected value of the ith variable (obtained from the training data), and n is the number of variables. A large value of denotes that the observed sample contains anomalies.

The following function calculates the respective values for all the elements in a collection:

When this function is called with the same data [1.;100.;2.;4.5;2.55;70.] as the observed data and [111.;100.;2.;4.5;2.55;710.] as the expected values then the following result is obtained:

[(1.0, 12100.0); (100.0, 0.0); (2.0, 0.0); (4.5, 0.0); (2.55, 0.0);
   (70.0, 5851.428571)]

As you can see, the value of is very high (121000.0 and 5851.428571) in the first and last observations. This means that the...

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