Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Machine Learning with Scala Quick Start Guide

You're reading from   Machine Learning with Scala Quick Start Guide Leverage popular machine learning algorithms and techniques and implement them in Scala

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789345070
Length 220 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Md. Rezaul Karim Md. Rezaul Karim
Author Profile Icon Md. Rezaul Karim
Md. Rezaul Karim
Ajay Kumar N Ajay Kumar N
Author Profile Icon Ajay Kumar N
Ajay Kumar N
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introduction to Machine Learning with Scala FREE CHAPTER 2. Scala for Regression Analysis 3. Scala for Learning Classification 4. Scala for Tree-Based Ensemble Techniques 5. Scala for Dimensionality Reduction and Clustering 6. Scala for Recommender System 7. Introduction to Deep Learning with Scala 8. Other Books You May Enjoy

To get the most out of this book

All the examples have been implemented in Scala with some open source libraries, including Apahe Spark MLlib/ML and Deeplearning4j. However, to get the best out of this, you should have a powerful computer and software stack.

A Linux distribution is preferable (for example, Debian, Ubuntu, or CentOS). For example, for Ubuntu, it is recommended to have at least a 14.04 (LTS) 64-bit complete installation on VMware Workstation Player 12 or VirtualBox. You can run Spark jobs on Windows (7/8/10) or macOS X (10.4.7+) as well.

A computer with a Core i5 processor, enough storage (for example, for running Spark jobs, you'll need at least 50 GB of free disk storage for standalone cluster and for the SQL warehouse), and at least 16 GB RAM are recommended. And optionally, if you want to perform the neural network training on the GPU (for the last chapter only), the NVIDIA GPU driver has to be installed with CUDA and CuDNN configured.

The following APIs and tools are required in order to execute the source code in this book:

  • Java/JDK, version 1.8
  • Scala, version 2.11.8
  • Spark, version 2.2.0 or higher
  • Spark csv_2.11, version 1.3.0
  • ND4j backend version nd4j-cuda-9.0-platform for GPU; otherwise, nd4j-native
  • ND4j, version 1.0.0-alpha
  • DL4j, version 1.0.0-alpha
  • Datavec, version 1.0.0-alpha
  • Arbiter, version 1.0.0-alpha
  • Eclipse Mars or Luna (latest version) or IntelliJ IDEA
  • Maven Eclipse plugin (2.9 or higher)
  • Maven compiler plugin for Eclipse (2.3.2 or higher)
  • Maven assembly plugin for Eclipse (2.4.1 or higher)

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Machine-Learning-with-Scala-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in Action

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "It gave me a Matthews correlation coefficient of 0.3888239300421191."

A block of code is set as follows:

rawTrafficDF.select("Hour (Coded)", "Immobilized bus", "Broken Truck", 
"Vehicle excess", "Fire", "Slowness in traffic (%)").show(5)

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

// Create a decision tree estimator
val dt = new DecisionTreeClassifier()
.setImpurity("gini")
.setMaxBins(10)
.setMaxDepth(30)
.setLabelCol("label")
.setFeaturesCol("features")

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

 +-----+-----+
|churn|count|
+-----+-----+
|False| 2278|
| True| 388 |
+-----+-----+

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Clicking the Next button moves you to the next screen."

Warnings or important notes appear like this.
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