Book Image

Scala for Machine Learning

By : Patrick R. Nicolas
Book Image

Scala for Machine Learning

By: Patrick R. Nicolas

Overview of this book

Table of Contents (20 chapters)
Scala for Machine Learning
About the Author
About the Reviewers

Naïve Bayes and text mining

The multinomial Naïve Bayes classifier is particularly suited for text mining. The Naïve Bayes formula is quite effective to classify the following entities:

  • E-mail spams

  • Business news stories

  • Movie reviews

  • Technical papers as per field of expertise

This third use case consists of predicting the direction of a stock given the financial news. There are two type of news that affect the stock of a particular company:

  • Macro trends: Economic or social news such as conflicts, economic trends, or labor market statistics

  • Micro updates: Financial or market news related to a specific company such as earnings, change in ownership, or press releases

Macroeconomic news related to a specific company have the potential to affect the sentiments of investors toward the company and may lead to a sudden shift in the price of its stock. Another important feature is the average time it takes for investors to react to the news and affect the price of the stock.

  • Long-term investors may react...