Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
F# for Machine Learning Essentials

You're reading from  F# for Machine Learning Essentials

Product type Book
Published in Feb 2016
Publisher
ISBN-13 9781783989348
Pages 194 pages
Edition 1st Edition
Languages
Author (1):
Sudipta Mukherjee Sudipta Mukherjee
Profile icon Sudipta Mukherjee

Table of Contents (16) Chapters

F# for Machine Learning Essentials
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Introduction to Machine Learning Linear Regression Classification Techniques Information Retrieval Collaborative Filtering Sentiment Analysis Anomaly Detection Index

Multiclass classification using decision trees


In Chapter 1, Introduction to Machine Learning, you saw how decision trees work to find several classes among unseen datasets. In the following section, you will see how to use WekaSharp, which is a wrapper on top of Weka to be used in a F# friendly way. Weka is an open source project for data mining and machine learning, written in Java (http://www.cs.waikato.ac.nz/ml/weka/).

Obtaining and using WekaSharp

You can download WekaSharp from https://wekasharp.codeplex.com/. Then you have to add the following DLLs in your F# application, as shown next:

In this example, you will see how to use WekaSharp to classify the iris flowers.

module DecisionTreesByWeka.Main

open System
open WekaSharp.Common
open WekaSharp.Classify
open WekaSharp.Dataset
open WekaSharp.Eval


[<EntryPoint>]
let main args = 
    let iris =            
            @"C:\iris.csv"
            |> WekaSharp.Dataset.readArff
            |> WekaSharp.Dataset.setClassIndexWithLastAttribute...
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 $15.99/month. Cancel anytime}