Mastering .NET Machine Learning
eBook - ePub

Mastering .NET Machine Learning

  1. 358 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering .NET Machine Learning

About this book

Master the art of machine learning with.NET and gain insight into real-world applications

About This Book

  • Based on.NET framework 4.6.1, includes examples on ASP.NET Core 1.0
  • Set up your business application to start using machine learning techniques
  • Familiarize the user with some of the more common.NET libraries for machine learning
  • Implement several common machine learning techniques
  • Evaluate, optimize and adjust machine learning models

Who This Book Is For

This book is targeted at.Net developers who want to build complex machine learning systems. Some basic understanding of data science is required.

What You Will Learn

  • Write your own machine learning applications and experiments using the latest.NET framework, including.NET Core 1.0
  • Set up your business application to start using machine learning.
  • Accurately predict the future using regressions.
  • Discover hidden patterns using decision trees.
  • Acquire, prepare, and combine datasets to drive insights.
  • Optimize business throughput using Bayes Classifier.
  • Discover (more) hidden patterns using KNN and Naive Bayes.
  • Discover (even more) hidden patterns using K-Means and PCA.
  • Use Neural Networks to improve business decision making while using the latest ASP.NET technologies.
  • Explore "Big Data", distributed computing, and how to deploy machine learning models to IoT devices – making machines self-learning and adapting
  • Along the way, learn about Open Data, Bing maps, and MBrace

In Detail

.Net is one of the widely used platforms for developing applications. With the meteoric rise of Machine learning, developers are now keen on finding out how can they make their.Net applications smarter. Also, .NET developers are interested into moving into the world of devices and how to apply machine learning techniques to, well, machines.

This book is packed with real-world examples to easily use machine learning techniques in your business applications. You will begin with introduction to F# and prepare yourselves for machine learning using.NET framework. You will be writing a simple linear regression model using an example which predicts sales of a product. Forming a base with the regression model, you will start using machine learning libraries available in.NET framework such as Math.NET, Numl.NET and Accord.NET with the help of a sample application. You will then move on to writing multiple linear regressions and logistic regressions.

You will learn what is open data and the awesomeness of type providers. Next, you are going to address some of the issues that we have been glossing over so far and take a deep dive into obtaining, cleaning, and organizing our data. You will compare the utility of building a KNN and Naive Bayes model to achieve best possible results.

Implementation of Kmeans and PCA using Accord.NET and Numl.NET libraries is covered with the help of an example application. We will then look at many of issues confronting creating real-world machine learning models like overfitting and how to combat them using confusion matrixes, scaling, normalization, and feature selection. You will now enter into the world of Neural Networks and move your line of business application to a hybrid scientific application. After you have covered all the above machine learning models, you will see how to deal with very large datasets using MBrace and how to deploy machine learning models to Internet of Thing (IoT) devices so that the machine can learn and adapt on the fly

Style and approach

This book will guide you in learning everything about how to tackle the flood of data being encountered these days in your.NET applications with the help of popular machine learning libraries offered by the.NET framework.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Mastering .NET Machine Learning


Table of Contents

Mastering .NET Machine Learning
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Welcome to Machine Learning Using the .NET Framework
What is machine learning?
Why .NET?
What version of the .NET Framework are we using?
Why write your own?
Why open data?
Why F#?
Getting ready for machine learning
Setting up Visual Studio
Learning F#
Third-party libraries
Math.NET
Accord.NET
Numl
Summary
2. AdventureWorks Regression
Simple linear regression
Setting up the environment
Preparing the test data
Standard deviation
Pearson's correlation
Linear regression
Math.NET
Regression try 1
Regression try 2
Accord.NET
Regression
Regression evaluation using RMSE
Regression and the real world
Regression against actual data
AdventureWorks app
Setting up the environment
Updating the existing web project
Implementing the regression
Summary
3. More AdventureWorks Regression
Introduction to multiple linear regression
Intro example
Keep adding x variables?
AdventureWorks data
Adding multiple regression to our production application
Considerations when using multiple x variables
Adding a third x variable to our model
Logistic regression
Intro to logistic regression
Adding another x variable
Applying a logistic regression to AdventureWorks data
Categorical data
Attachment point
Analyzing results of the logistic regression
Adding logistic regression to the application
Summary
4. Traffic Stops – Barking Up the Wrong Tree?
The scientific process
Open data
Hack-4-Good
FsLab and type providers
Data exploration
Visualization
Decision trees
Accord
numl
Summary
5. Time Out – Obtaining Data
Overview
SQL Server providers
Non-type provider
SqlProvider
Deedle
MicrosoftSqlProvider
SQL Server type provider wrap up
Non SQL type providers
Combining data
Parallelism
JSON type provider – authentication
Summary
6. AdventureWorks Redux – k-NN and Naïve Bayes Classifiers
k-Nearest Neighbors (k-NN)
k-NN example
Naïve Bayes
Naïve Bayes in action
One thing to keep in mind while using Naïve Bayes
AdventureWorks
Getting the data ready
k-NN and AdventureWorks data
Naïve Bayes and AdventureWorks data
Making use of our discoveries
Getting the data ready
Expanding features
Summary
7. Traffic Stops and Crash Locations – When Two Datasets Are Better Than One
Unsupervised learning
k-means
Principle Component Analysis (PCA)
Traffic stop and crash exploration
Preparing the script and the data
Geolocation analysis
PCA
Analysis summary
The Code-4-Good application
Machine learning assembly
The UI
Adding distance calculations
Augmenting with human observations
Summary
8. Feature Selection and Optimization
Cleaning data
Selecting data
Collinearity
Feature selection
Normalization
Scaling
Overfitting and cross validation
Cross validation – train versus test
Cross validation – the random and mean test
Cross validation – the confusion matrix and AUC
Cross validation – unrelated variables
Summary
9. AdventureWorks Production – Neural Networks
Neural networks
Background
Neural network demo
Neural network – try #1
Neural network – try #2
Building the application
Setting up the models
Building the UX
Summary
10. Big Data and IoT
AdventureWorks and the Internet of Bikes
Data considerations
MapReduce
MBrace
Distributed logistic regression
The IoT
PCL linear regression
Service layer
Universal Windows app and Raspberry Pi 2
Next steps
Summary
Index

Mastering .NET Machine Learning

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2016
Production reference: 1210316
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-840-3
www.packtpub.com

Credits

Author
Jamie Dixon
Reviewers
Reed Copsey, Jr.
César Roberto de Souza
Commissioning Editor
Vedika Naik
Acquisition Editor
Meeta Rajani
Technical Editor
Pankaj Kadam
Copy Editor
Laxmi Subramanian
Proofreader
Safis Editing
Indexer
Rekha Nair
Graphics
Jason Monteiro
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat

About the Author

Jamie Dixon has been writing code for as long as he can remember and has been getting paid to do it since 1995. He was using C# and JavaScript almost exclusively until discovering F#, and now combines all three languages for the problem at hand. He has a passion for discovering overlooked gems in datasets and merging software engineering techniques to scientific computing. When he codes for fun, he spends his time using Phidgets, Netduinos, and Raspberry Pis or spending time in Kaggle competitions using F# or R.
Jamie is a bachelor of science in computer science and has been an F# MVP since 2014. He is the former chair of his town's Information Services Advisory Board and is an outspoken advocate of open data. He is also invol...

Table of contents

  1. Mastering .NET Machine Learning

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Mastering .NET Machine Learning by Jamie Dixon in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Processing. We have over one million books available in our catalogue for you to explore.