Book Image

Modern Scala Projects

By : Ilango gurusamy
Book Image

Modern Scala Projects

By: Ilango gurusamy

Overview of this book

Scala is both a functional programming and object-oriented programming language designed to express common programming patterns in a concise, readable, and type-safe way. Complete with step-by-step instructions, Modern Scala Projects will guide you in exploring Scala capabilities and learning best practices. Along the way, you'll build applications for professional contexts while understanding the core tasks and components. You’ll begin with a project for predicting the class of a flower by implementing a simple machine learning model. Next, you'll create a cancer diagnosis classification pipeline, followed by tackling projects delving into stock price prediction, spam filtering, fraud detection, and a recommendation engine. The focus will be on application of ML techniques that classify data and make predictions, with an emphasis on automating data workflows with the Spark ML pipeline API. The book also showcases the best of Scala’s functional libraries and other constructs to help you roll out your own scalable data processing frameworks. By the end of this Scala book, you’ll have a firm foundation in Scala programming and have built some interesting real-world projects to add to your portfolio.
Table of Contents (14 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Chapter 3. Stock Price Predictions

Thegoal of this chapter is to predict the values of near-or long-term equity prices by using machine learning (ML). From an investor's perspective, investments (in equity) across several companies are stocks, while such investments in an individual company are shares. Most investors lean on a long-term investment strategy for the best returns. Investment analysts employ mathematical stock analysis models to help predict future stock prices or price movements in the long term. Such models factor in past equity prices and other indicators to perform a company's financial health evaluation.

The overarching learning objective of this chapter is to implement a Scala solution that will predict stock market prices. Starting from the stock price prediction dataset, we will use the Spark ML library's ML APIs to build a stock price prediction pipeline.

Here is the dataset we will refer to:

  • Daily News for Stock Market Prediction | Kaggle.
  • In-text: (Kaggle.com, 2018) Daily...