This project uses historical data of the Bank Nifty index over the last 10 years to predict future stock prices using Machine Learning models. It features a web-based client to visualize the predictions.
Backend:
Frontend:
Data & Modeling:
.
āāā client/ # Svelte frontend application
āāā server/ # Flask backend server
āāā model/ # Saved model files (.h5, .pkl)
āāā data/ # Raw and processed data files (.csv)
āāā *.ipynb # Jupyter notebooks for experimentation
āāā README.md
pip
and npm
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name/server/ml-with-stocks
Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install Python dependencies:
pip install -r requirements.txt
Navigate to the client directory:
cd ../../client
Install Node.js dependencies:
npm install
Run the Backend Server:
From the server/ml-with-stocks
directory, start the Flask server.
waitress-serve --host 127.0.0.1 --port 5000 app:app
The server will be running at http://127.0.0.1:5000
.
Run the Frontend Client:
From the client
directory, start the Vite development server.
npm run dev
The client will be available at http://localhost:3000
(or another port if 3000 is busy).
The Jupyter notebooks (.ipynb
files) in the notebooks
directory contain the code for data preprocessing, model training, and evaluation. You can explore these notebooks to understand the different strategies used for training the LSTM and XGBoost models.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
This project is open-source. See the LICENSE file for details.