GithubHelp home page GithubHelp logo

kaushikjadhav01 / stock-market-prediction-web-app-using-machine-learning-and-sentiment-analysis Goto Github PK

View Code? Open in Web Editor NEW
544.0 544.0 196.0 37.55 MB

Stock Market Prediction Web App based on Machine Learning and Sentiment Analysis of Tweets (API keys included in code). The front end of the Web App is based on Flask and Wordpress. The App forecasts stock prices of the next seven days for any given stock under NASDAQ or NSE as input by the user. Predictions are made using three algorithms: ARIMA, LSTM, Linear Regression. The Web App combines the predicted prices of the next seven days with the sentiment analysis of tweets to give recommendation whether the price is going to rise or fall

License: MIT License

Python 100.00%
alphavantage arima flask keras linear-regression lstm machine-learning python sentiment-analysis stock-market stock-price-prediction tensorflow tweepy twitter wordpress yfinance

stock-market-prediction-web-app-using-machine-learning-and-sentiment-analysis's Introduction

DOI License Code Coverage GitHub contributors Documentation Status GitHub release (latest by date) GitHub issues GitHub closed issues GitHub Repo Size GitHub last commit GitHub language count Commit Acitivity Code Size GitHub forks GitHub stars GitHub watchers

Stock-Market-Prediction-Web-App-using-Machine-Learning

Stock Market Prediction Web App based on Machine Learning and Sentiment Analysis of Tweets (API keys included in code). The front end of the Web App is based on Flask and Wordpress. The App forecasts stock prices of the next seven days for any given stock under NASDAQ or NSE as input by the user. Predictions are made using three algorithms: ARIMA, LSTM, Linear Regression. The Web App combines the predicted prices of the next seven days with the sentiment analysis of tweets to give recommendation whether the price is going to rise or fall.

Table of Contents
  1. System Description and Functions
  2. Built With
  3. Installation
  4. Authors
  5. Links

System Description and Functions

Demo Video:


Screenshots:

Admin Creds:
Username: admin
Email Address: [email protected]
Password: Samplepass@123

There are two roles in the system: Admin and User.

Users can:

  1. Register and Login
  2. Check Real Time stock prices
  3. Read recent news about different stocks
  4. Currency Converter
  5. Edit or delete their own profile
  6. Educate the user about stocks
  7. Download list of stock tickers
  8. Predict Stock prices for the next 7 days for all NASDAQ and NSE stocks

Admin can:

  1. Create, Retrieve, Update Delete Users.
  2. Manually trigger emails.
  3. Register and Login
  4. Check Real Time stock prices
  5. Read recent news about different stocks
  6. Currency Converter
  7. Edit or delete their own profile
  8. Educate the user about stocks
  9. Download list of stock tickers
  10. Predict Stock prices for the next 7 days for all NASDAQ and NSE stocks

Built With

Python Javascript django nodejs react html css bootstrap jquery wordpress Keras Numpy pandas

Installation

  1. Install XAMPP server
  2. Download wordpress zip folder from this link.
  3. Extract the downloaded zip into htdocs folder of XAMPP.
  4. Open the wp-config.php file from the extracted folder and add your phpmyadmin username and password.
  5. Go to phpmyadmin, create a new database called wordpress.
  6. Select this database, go to Operations tab and Import the wordpress.sql file into this created databse.
  7. Clone the repo, cd into it
  8. Run pip install -r requirements.txt
  9. Run python main.py to start server.
  10. Go to localhost/wordpress to access the app.

Find more screenshots in the screenshots folder Or click here

Authors

Kaushik Jadhav

Links

stock-market-prediction-web-app-using-machine-learning-and-sentiment-analysis's People

Contributors

kaushikjadhav01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stock-market-prediction-web-app-using-machine-learning-and-sentiment-analysis's Issues

app crashed at the second prediction

Exception ignored in: <function Image.__del__ at 0x0000000017BD3DC8> Traceback (most recent call last): File "C:\Users\#####\AppData\Local\conda\conda\envs\py37\lib\tkinter\__init__.py", line 3507, in __del__ self.tk.call('image', 'delete', self.name) RuntimeError: main thread is not in main loop Exception ignored in: <function Image.__del__ at 0x0000000017BD3DC8> Traceback (most recent call last): File "C:\Users\#####\AppData\Local\conda\conda\envs\py37\lib\tkinter\__init__.py", line 3507, in __del__ self.tk.call('image', 'delete', self.name) RuntimeError: main thread is not in main loop Tcl_AsyncDelete: async handler deleted by the wrong thread

internal server error while predicting the stock price

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\flask\app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Movies\Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis-master\main.py", line 478, in insertintotable
lstm_pred, error_lstm=LSTM_ALGO(df)
^^^^^^^^^^^^^
File "c:\Movies\Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis-master\main.py", line 180, in LSTM_ALGO
from keras.models import Sequential
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras_init_.py", line 21, in
from keras import models
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\models_init_.py", line 18, in
from keras.engine.functional import Functional
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\engine\functional.py", line 26, in
from keras import backend
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\backend.py", line 35, in
from keras.engine import keras_tensor
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\engine\keras_tensor.py", line 19, in
from keras.utils import object_identity
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\utils_init_.py", line 20, in
from keras.saving.legacy.serialization import deserialize_keras_object
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\saving\legacy\serialization.py", line 22, in
from keras.utils import tf_contextlib
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\utils\tf_contextlib.py", line 17, in
from tensorflow.python.keras.utils import tf_contextlib
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\tensorflow\python\keras_init_.py", line 25, in
from tensorflow.python.keras import models
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\tensorflow\python\keras\models.py", line 18, in
from tensorflow.python.framework import ops

Credentials

Hello bro,

It's asking for WordPress login JKS

what's the login and password
I checked in WordPress named MySQL db it's showing three credentials for users but password has not been working....
Please suggest

And also I had to install tensorflow 2.2.0
Because tensorflow 1.14 didnot have matching distribution

But please tell something about llogin after import** login ** for jks has come...but unable to login

and in wordpress JKS login this warning is there

Warning: Declaration of QuietSkin::feedback($string) should be compatible with WP_Upgrader_Skin::feedback($string, ...$args) in /opt/lampp/htdocs/testsite/wp-content/plugins/ocean-extra/includes/wizard/classes/QuietSkin.php on line 12

just a question

hi bro,

I setup the wordpress then I installed the All in One Migration plugin
my question is that after plugin installation do I have to "Activate the All in one Migration plugin"..

then i do download and import wordpress file into the wordpress!!!

sample_env file error

what is contained in sample env file?
plz do clear this i am getting an error at this stage

Screenshot (55)

RuntimeError: main thread is not in main loop

Dear Kaushik,

Today I tried to find stock forecasting opensource projects in python came across many but due to some or other issue many programs are not able to run(deprecated), during the course i found your project and details are very clear and thought of giving a try and it worked perfect in the first try itself., UI is very easy to use and the results populated with much ease compared to other programs, thank you very much for sharing such a valuable project to the public but i will evaluate the predictions during next week.
In between i found some issue with the main.py program it gives below error on each new scrip search, i end up closing the console and run again it works, if possible can you provide me any updated python scripts to fix this issue?

Do we expect any future upgrade on predictions to show next day high and low prices aswell?

Error message:

Exception ignored in: <function Image.del at 0x000002288D1DAB80>
Traceback (most recent call last):
File "C:\Python38\lib\tkinter_init_.py", line 4014, in del
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.del at 0x000002288D1DAB80>
Traceback (most recent call last):
File "C:\Python38\lib\tkinter_init_.py", line 4014, in del
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Tcl_AsyncDelete: async handler deleted by the wrong thread

Regards,
[email protected]

IndexError: list index out of range

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/Users/ravisekharsapare/Downloads/stockprediction/Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis/main.py", line 479, in insertintotable
polarity,tw_list,tw_pol,pos,neg,neutral = retrieving_tweets_polarity(quote)
File "/Users/ravisekharsapare/Downloads/stockprediction/Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis/main.py", line 336, in retrieving_tweets_polarity
symbol = stock_full_form['Name'].to_list()[0][0:12]
IndexError: list index out of range

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/Users/macbook/Downloads/Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis-master/main.py", line 475, in insertintotable
polarity,tw_list,tw_pol,pos,neg,neutral = retrieving_tweets_polarity(quote)
File "/Users/macbook/Downloads/Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis-master/main.py", line 368, in retrieving_tweets_polarity
for sentence in blob.sentences:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/textblob/decorators.py", line 24, in get
value = obj.dict[self.func.name] = self.func(obj)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/textblob/blob.py", line 639, in sentences
return self._create_sentence_objects()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/textblob/blob.py", line 683, in _create_sentence_objects
sentences = sent_tokenize(self.raw)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/textblob/base.py", line 64, in itokenize
return (t for t in self.tokenize(text, *args, **kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/textblob/decorators.py", line 38, in decorated
raise MissingCorpusError()
textblob.exceptions.MissingCorpusError:
Looks like you are missing some required data for this feature.

Error establishing a database connection

Followed all steps as given but still having this error establishing a database connection on a MacOS. Don't understand the problem is all admin credentials are correct.
Screenshot 2021-04-07 at 1 13 11 AM

Issues with wordpress links

Hello. I'm excited to use the program, but I can't get the links in wordpress to work. I've installed it on xampp/Linux mint 19. Here is what I've tried so far.

Updated WP permalinks
Updated . Htaccess file (tried multiple variations)

Any ideas?
Thanks

Internal Server Error

Hello,
When I run the application I have the following.

Καταγραφή2
the page is not as complete as yours

Καταγραφή1

and finally I have the following error

Καταγραφή

Thanks,

not predicting any stock

when i run predict the future and write my stock i get this in vscode
requests.exceptions.JSONDecodeError: [Errno Expecting value] Forbidden: 0

Regard Guidance

Hi Kaushik,
I'm working on the same project in final year
can you please guide me the working of your project.

New complementary tool

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.