Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Apache Mahout
  • Table Of Contents Toc
Learning Apache Mahout

Learning Apache Mahout

By : Chandramani Tiwary
3 (1)
close
close
Learning Apache Mahout

Learning Apache Mahout

3 (1)
By: Chandramani Tiwary

Overview of this book

If you are a Java developer and want to use Mahout and machine learning to solve Big Data Analytics use cases then this book is for you. Familiarity with shell scripts is assumed but no prior experience is required.
Table of Contents (12 chapters)
close
close
Lock Free Chapter
1
1. Introduction to Mahout
9
9. Case Study – Churn Analytics and Customer Segmentation
11
Index

Code example with logistic regression


Any machine learning algorithm in Mahout requires a few steps.

For classification, the steps are as follows:

  1. Read the file, line by line.

  2. Encode the features into vectors by splitting the line on the delimiters.

  3. If running the MapReduce implementation, convert the vector to the sequence file.

  4. Train the model by passing the vector and target variable.

  5. Test the model.

Import the code folder, which comes with the book into Eclipse or your favorite editor. Go to the package chapter4.src.logistic and open the file OnlineLogisticRegressionTrain.java.

Train the model

Here, we are reading the file:

String inputFile = "data/chapter4/train_data/input_bank_data.csv";
String outputFile = "data/chapter4/logistic/model";

We create the predictor list, the names of the column used as predictors:

List<String> predictorList =Arrays.asList("age","job","marital","education","default",    "housing","loan","contact","month","day_of_week","duration","campaign","pdays","previous...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Apache Mahout
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon