Skip to content

Implementation of various machine learning algorithms in the prediction of Kenya's stock market performance.

License

Notifications You must be signed in to change notification settings

SpencerOfwiti/StockML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock ML

License: GPL v3 GitHub repo size Open Source

Implementation of stock market price prediction of various Kenyan companies' shares including Safaricom e.t.c. It utilizes various Machine Learning algorithms such as Long Short Term Memory(LSTM), Prophet and Auto-Regressive Intergrated Moving Average(ARIMA). It bases it's analysis on historical trading data dating back more than five years.

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.

Build Status

Build Status

Built With

Features

  • Aggregate daily stock closing price.
  • Exploration and cleaning of companies' stock prices data.
  • Application of machine learning algorithms in stock price prediction.
  • Visualization of stock price predictions.

Code Example

def check_null_values(data):
	"""
	check if processed data has no null variables
	:param data:
	:return:
	"""
	return data.isnull().sum().sum()


print(check_null_values(data))

Prerequisites

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

  • python 3

Linux:

sudo apt-get install python3.6

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:

git clone https://github.com/SpencerOfwiti/stock-ml

To set up virtual environment and install dependencies:

source setup.sh

To set up project path:

source .env

To run python scripts:

python src/data/make_dataset.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

See also the list of contributors who participated in this project.

contributors

License

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

Acknowledgments

Reports

About

Implementation of various machine learning algorithms in the prediction of Kenya's stock market performance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages