Book Image

Java Data Science Cookbook

By : Rushdi Shams
Book Image

Java Data Science Cookbook

By: Rushdi Shams

Overview of this book

If you are looking to build data science models that are good for production, Java has come to the rescue. With the aid of strong libraries such as MLlib, Weka, DL4j, and more, you can efficiently perform all the data science tasks you need to. This unique book provides modern recipes to solve your common and not-so-common data science-related problems. We start with recipes to help you obtain, clean, index, and search data. Then you will learn a variety of techniques to analyze, learn from, and retrieve information from data. You will also understand how to handle big data, learn deeply from data, and visualize data. Finally, you will work through unique recipes that solve your problems while taking data science to production, writing distributed data science applications, and much more - things that will come in handy at work.
Table of Contents (16 chapters)
Java Data Science Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Applying an online logistic regression model using Apache Mahout


In this recipe, we will demonstrate how you can apply an online logistic regression model on unseen, unlabeled test data using Apache Mahout. Note that this recipe is very closely related to the previous recipe and requires you to build a model using training data. This requirement is demonstrated in the previous recipe.

Getting ready

  1. After completing the previous recipe, go to the project folder that you created, and go inside the directory named model that you created in the last recipe. You should see a model file there.

  2. Next, create a test file. Go to the data folder that you created in your project folder in the last recipe. Create a test file named weather.numeric.test.csv with the following data:

            outlook,temperature,humidity,windy,play 
            overcast,90,80,TRUE,yes 
            overcast,95,88,FALSE,yes 
            rainy,67,78,TRUE,no 
            rainy,90,97,FALSE,no 
            sunny,50,67,FALSE,yes...