This repository contains the necessary files to preprocess data, train an LSTM model for predicting heart rates, and create an interface for predicting heart rates using the trained model. The model weights and scaler parameters are saved for future use.
This Jupyter Notebook file is dedicated to the preprocessing of the data, feature extraction, scaling, and training of the LSTM model for predicting heart rates. The process involves loading the dataset, extracting relevant features, scaling the data, defining and training the LSTM model, and finally, saving the model weights and scaler parameters.
model.h5
: Contains the trained LSTM model weights.scaler_params.pkl
: Pickled file containing the parameters used for scaling the input data.
This Python script serves as an interface for predicting heart rates using the trained model and scaler parameters saved in the previous step. When executed, it prompts the user to input a file (dataset) for heart rate prediction. The script then loads the model and scaler parameters, processes the input file, and displays the predicted heart rates and store it in a '.csv file' named 'results.csv'.
To execute the script, use the following command: python run.py
This Jupyter Notebook file is used to test the functionality of run.py
by providing a small dataset (10 rows). It loads the data from the file, runs it through the prediction interface (run.py
), and checks the results.
- Open and run
traindata.ipynb
to understand how to preprocess data, train the LSTM model, and save model weights and scaler parameters. - Execute
run.py
to interactively input the desired dataset file and get heart rate predictions using the trained model by replacing the line 8 of code with your 'testdata.csv' file.
- Python 3.x
- Jupyter Notebook
- Libraries: TensorFlow, NumPy, Pandas (for
traindata.ipynb
andfile_predict.ipynb
), Pickle (for saving scaler parameters) - Use python version- 3.10.13 if possible(most of python versions dont support keras and tensorflow simultaneously) Make sure to install the required libraries using: pip install tensorflow numpy pandas
Aniruddh Pandav
[email protected]
96182 18601
Vidit Parikh
[email protected]
75738 53202
Dev Kaushal
[email protected]
73557 74136