naimkatiman / MLstockApp

This repo hosts a web app that predicts stock trends using machine learning and tweet sentiment analysis. It combines historical data with real-time tweet sentiment for accurate insights. Features include trend forecasting and visualizations using Python, WordPress Flask, JS, HTML/CSS, Twitter API, Keras, Tensorflow, and scikit-learn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLstockApp: Stock Market Forecasting Web App using Machine Learning and Sentiment Analysis

This project is a web application designed to predict stock market trends using a combination of machine learning algorithms and sentiment analysis of tweets. By integrating real-time public sentiment with historical data, MLstockApp aims to provide more accurate and timely investment insights.

Table of Contents

Features

  • Real-time Sentiment Analysis: Integrates Twitter API to fetch live tweets and analyze their sentiment.
  • Machine Learning Predictions: Uses historical stock data and advanced machine learning models to predict future stock prices.
  • Interactive Dashboards: Visualizes stock trends, sentiment analysis results, and prediction outcomes.
  • User Authentication: Secure user login and registration functionality.

Technologies Used

  • Frontend: HTML, CSS, JavaScript, Bootstrap
  • Backend: Flask, SQLAlchemy
  • Database: SQLite
  • Machine Learning: Scikit-Learn, Pandas, Numpy
  • Sentiment Analysis: VaderSentiment, Tweepy
  • Visualization: Matplotlib, Plotly

Installation

Follow these steps to get the project up and running on your local machine.

  1. Clone the repository:

    git clone https://github.com/kaushikjadhav01/Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis.git
    cd Stock-Market-Prediction-Web-App-using-Machine-Learning-And-Sentiment-Analysis
  2. Create a virtual environment:

    python -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate
  4. Install the required packages:

    pip install -r requirements.txt
  5. Set up environment variables:

    • Create a .env file in the root directory of the project.
    • Add your Twitter API keys and other necessary configurations to the .env file.

    Example:

    TWITTER_API_KEY=your_api_key
    TWITTER_API_SECRET_KEY=your_api_secret_key
    TWITTER_ACCESS_TOKEN=your_access_token
    TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret
  6. Initialize the database:

    flask db init
    flask db migrate -m "Initial migration."
    flask db upgrade
  7. Run the application:

    flask run
  8. Access the application: Open your browser and navigate to http://127.0.0.1:5000.

Usage

  1. Register/Login: Create an account or log in to access the application.
  2. Select Stock: Choose the stock you want to analyze.
  3. Fetch Data: The application will retrieve historical stock data and live tweets related to the selected stock.
  4. View Predictions: Analyze the predicted stock prices and sentiment analysis results on the interactive dashboard.

Project Structure

MLstockApp/
│
├── app/
│   ├── __init__.py
│   ├── routes.py
│   ├── models.py
│   ├── static/
│   ├── templates/
│   └── utils/
├── migrations/
├── tests/
├── .env
├── .gitignore
├── README.md
├── requirements.txt
└── run.py

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

MLstockApp: Stock Market Forecasting Web App using Machine Learning and Sentiment Analysis

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.

System Description and Functions

Screenshots:

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.

About

This repo hosts a web app that predicts stock trends using machine learning and tweet sentiment analysis. It combines historical data with real-time tweet sentiment for accurate insights. Features include trend forecasting and visualizations using Python, WordPress Flask, JS, HTML/CSS, Twitter API, Keras, Tensorflow, and scikit-learn

License:Apache License 2.0


Languages

Language:PHP 42.3%Language:CSS 27.4%Language:JavaScript 18.7%Language:SCSS 8.6%Language:Less 2.5%Language:HTML 0.3%Language:Python 0.1%Language:Hack 0.1%