# Clojure for Machine Learning

Formats:

save 15%!

save 6%!

**Free Shipping!**

Also available on: |

- Covers a lot of machine learning techniques with Clojure programming.
- Encompasses precise patterns in data to predict future outcomes using various machine learning techniques
- Packed with several machine learning libraries available in the Clojure ecosystem

### Book Details

**Language :**English

**Paperback :**292 pages [ 235mm x 191mm ]

**Release Date :**April 2014

**ISBN :**1783284358

**ISBN 13 :**9781783284351

**Author(s) :**Akhil Wali

**Topics and Technologies :**All Books, Big Data and Business Intelligence, Open Source

## Table of Contents

PrefaceChapter 1: Working with Matrices

Chapter 2: Understanding Linear Regression

Chapter 3: Categorizing Data

Chapter 4: Building Neural Networks

Chapter 5: Selecting and Evaluating Data

Chapter 6: Building Support Vector Machines

Chapter 7: Clustering Data

Chapter 8: Anomaly Detection and Recommendation

Chapter 9: Large-scale Machine Learning

Appendix: References

Index

- Chapter 1: Working with Matrices
- Introducing Leiningen
- Representing matrices
- Generating matrices
- Adding matrices
- Multiplying matrices
- Transposing and inverting matrices
- Interpolating using matrices
- Summary

- Chapter 2: Understanding Linear Regression
- Understanding single-variable linear regression
- Understanding gradient descent
- Understanding multivariable linear regression
- Gradient descent with multiple variables

- Understanding Ordinary Least Squares
- Using linear regression for prediction
- Understanding regularization
- Summary

- Chapter 3: Categorizing Data
- Understanding the binary and multiclass classification
- Understanding the Bayesian classification
- Using the k-nearest neighbors algorithm
- Using decision trees
- Summary

- Chapter 4: Building Neural Networks
- Understanding nonlinear regression
- Representing neural networks
- Understanding multilayer perceptron ANNs
- Understanding the backpropagation algorithm
- Understanding recurrent neural networks
- Building SOMs
- Summary

- Chapter 5: Selecting and Evaluating Data
- Understanding underfitting and overfitting
- Evaluating a model
- Understanding feature selection

- Varying the regularization parameter
- Understanding learning curves
- Improving a model
- Using cross-validation
- Building a spam classifier
- Summary

- Understanding underfitting and overfitting

- Chapter 6: Building Support Vector Machines
- Understanding large margin classification
- Alternative forms of SVMs

- Linear classification using SVMs
- Using kernel SVMs
- Sequential minimal optimization
- Using kernel functions

- Summary

- Understanding large margin classification

- Chapter 7: Clustering Data
- Using K-means clustering
- Clustering data using clj-ml

- Using hierarchical clustering
- Using Expectation-Maximization
- Using SOMs
- Reducing dimensions in the data
- Summary

- Using K-means clustering

- Chapter 8: Anomaly Detection and Recommendation
- Detecting anomalies
- Building recommendation systems
- Content-based filtering
- Collaborative filtering
- Using the Slope One algorithm
- Summary

- Chapter 9: Large-scale Machine Learning
- Using MapReduce
- Querying and storing datasets
- Machine learning in the cloud
- Summary

### Akhil Wali

### Code Downloads

Download the code and support files for this book.

### Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

### Errata

- 4 submitted: last submission 27 May 2014**Page: 23 | Type: Technical**

**In core.matrix 0.3.0, M/* can be used to perform both inner product multiplication as well as element-wise multiplication.**

** **

**In versions of core.matrix greater than 0.10.0, M/* only performs element-wise multiplication.**

**__________________________________________________________________________________________________**

**Page: 9 | Type: Technical**

**This is valid issue. It should be ':use' instead of ':import' in the information box**

**____________________________________________________________________________________**

**Page: 24 | Type: Technical**

**It must be 'm x q' in the second para.**

**78**| Type:

**Code**

**(/ positive total)**instead of

**(/ positive negative)**.

Here's what the corrected version of the function should be:

**Page: 17 | Type: Code**

The code given in the book is as follows:

(defn id-mat

"Creates an identity matrix of n x n size"

[n]

(let [init (square-mat :clatrix n 0)

identity-f (fn [i j n]

(if (= i j) 1 n))]

(cl/map-indexed identity-f init)))

It should be as follows:

(defn id-mat

"Creates an identity matrix of n x n size"

[n]

(let [init (square-mat n 0 :implementation :clatrix)

identity-f (fn [i j n]

(if (= i j) 1 n))]

(cl/map-indexed identity-f init)))

**Page: 18 | Type: Code**

The code given in the book is as follows:

(defn rand-square-clmat

"Generates a random clatrix matrix of size n x n"

[n]

(cl/map rand-int (square-mat :clatrix n 100)))

It should be as follows:

### Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

- Build systems that use machine learning techniques in Clojure
- Understand machine learning problems such as regression, classifi cation, and clustering
- Discover the data structures used in machine learning techniques such as artifi cial neural networks and support vector machines
- Implement machine learning algorithms in Clojure
- Learn more about Clojure libraries to build machine learning systems
- Discover techniques to improve and debug solutions built on machine learning techniques
- Use machine learning techniques in a cloud architecture for the modern Web

Clojure for Machine Learning is an introduction to machine learning techniques and algorithms. This book demonstrates how you can apply these techniques to real-world problems using the Clojure programming language.

It explores many machine learning techniques and also describes how to use Clojure to build machine learning systems. This book starts off by introducing the simple machine learning problems of regression and classification. It also describes how you can implement these machine learning techniques in Clojure. The book also demonstrates several Clojure libraries, which can be useful in solving machine learning problems.

Clojure for Machine Learning familiarizes you with several pragmatic machine learning techniques. By the end of this book, you will be fully aware of the Clojure libraries that can be used to solve a given machine learning problem.

A book that brings out the strengths of Clojure programming that have to facilitate machine learning. Each topic is described in substantial detail, and examples and libraries in Clojure are also demonstrated.

If you are a Clojure developer who wants to explore the area of machine learning, this book is for you. Basic understanding of the Clojure programming language is required. Familiarity with theoretical concepts and notation of mathematics and statistics would be an added advantage.