Skip to content

Minjire/sentiment_analysis_stock_ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis Stock ML

License: GPL v3 GitHub repo size Open Source contributors

Implementation of stock market sentiment prediction of various Kenyan companies' shares including Safaricom e.t.c. It utilizes Machine Learning algorithms such as Long Short Term Memory(LSTM). It bases it's analysis on general sentiments on the company stock price on blogs and social networks. It collects data by use of a web scraper.

Table of contents

Motivation

This project was born out of the need to make financial literacy and investment options available for the common citizen. Over the years the number of individuals investing in the Kenyan Securities Market has reduced. More and more of the trading is being done by investment companies and wealthy investors. This provides a platform to lower the barriers to entry for everyone keen on investing in the securities market. It provides daily predictions on the stock price for the next day and an overview of what to expect in the coming week.

Built With

  • Python 3.8 - The programming language used.
  • Pytest - The testing framework used.

Code Example

# %% predict data
raw_predictions = model.predict(padded_saf_test)
print(raw_predictions[:10])

Prerequisites

What things you need to install the software and how to install them

  • python 3

Linux:

sudo apt-get install python3.8

Windows:

Download from python.org

Mac OS:

brew install python3
  • pip

Linux and Mac OS:

pip install -U pip

Windows:

python -m pip install -U pip

Installation

Clone this repository while updating submodules:

git clone https://github.com/Minjire/sentiment_analysis_stock_ml

To set up virtual environment and install dependencies:

source setup.sh

To run python scripts:

python src/sentiment/modelling.py

Tests

This system uses pytest to run automated tests.

To run automated tests:

pytest

Deployment

Add additional notes about how to deploy this on a live system

Contributions

To contribute, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request.

Bug / Feature Request

If you find a bug (the website couldn't handle the query and / or gave undesired results), kindly open an issue here by including your search query and the expected result.

If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.

Authors

github follow twitter follow

github follow twitter follow

github follow

License

This project is licensed under the GNU General Public License V3.0 - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages