Giter Club home page Giter Club logo

predicting-driver-stress-using-deep-learning's Introduction

Hi there ๐Ÿ‘‹

Open-source projects are a clear proof that people can learn, work, and improve themselves by cooperating with one another. It is for this reason that I have decided to post all my work here. So, if you have a question related to my repositories, please send me an email by clicking here.

Further, here are some fun facts about me:

  • ๐Ÿช I love cooking but I hate washing the dishes.
  • ๐Ÿ˜ก Chess is my favorite game until the moment I start loosing matches.
  • ๐Ÿ˜‹ Although I like talking to people, I prefer working from home.
  • ๐Ÿƒ I love running long distances but not marathons.

predicting-driver-stress-using-deep-learning's People

Contributors

kryekuzhinieri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

predicting-driver-stress-using-deep-learning's Issues

Conversion

Sir, after this script a_convert_to_csv.py, an empty folder is created, the respective folder does not contain any csv file, can you please help me, how to do the conversion properly?

Code that I am using

from pathlib import Path

import numpy as np
import pandas as pd
import wfdb # WaveForm-Database package. A library of tools for reading, writing, and processing WFDB signals and annotations.

def convert_to_csv(path='stress-recognition-in-automobile-drivers-1.0.0./', new_folder=True):
"""
Code to convert all .dat files (ECG signals) in a folder to CSV format
Path - location of the dat files (str)
new_folder - whether to put the files in a new csv folder (boolean)

@authors: Abhishek Patil, Enes Ahmeti
"""
print('Reading files...')
if new_folder:
    Path(path).joinpath("csv_files").mkdir(parents=True, exist_ok=True)
# Get list of all .dat files in the current folder
for file in read_data(path=path, extension="*.dat"):
    print(file)
    # Get only the name from file.
    filename = file.stem
    # Read the signal data
    record, fields = wfdb.rdsamp(filename)
    # Drive7 hand GSR is misspelled.
    fields['sig_name'] = ["hand GSR" if s == "hand GSr" else s for s in fields['sig_name']]
    # Column headers
    header = ",".join(["-".join(x) for x in zip(fields['sig_name'], fields['units'])])
    # Add to the corresponding folder
    filename = Path(path).joinpath("csv_files") / f"{filename}.csv" if new_folder else f"{filename}.csv"
    np.savetxt(filename, record, delimiter=",", header=header, comments="")
print('All files read successfully!')

def read_data(path, extension=".csv"):
"""
Function to read the all the csv/dat files.
Since there are many files, it returns an iterator.
path - path to the csv/dat files.
extension - csv/dat. (if csv, it returns the dataframe else only filename)
"""
file_paths = Path(path).glob(extension)
for file in file_paths:
if extension == "
.csv":
dataset = pd.read_csv(file)
yield file.stem, dataset
else:
yield file

convert_to_csv()

It would be a great help.

Result Verification

Sir, for the e_models.py

I have run this file using the following the code
if name == "main":
main(
feature_selection="rf", # Choose one: "lda", "pca", "autoencoder", "rf"
classifier="loop", # Choose one: "rf", "rnn", "loop"
undersample=True, # True or False
shuffle=True, # True or False
path=DATASET_PATH, # Provide the path to your dataset CSV file
)
Can you confirm that, if I am running the code in the proper way or not?

After running this code
I got the following results (Accuracy on the Testing Data)
lda + rf -> 54.76
lda + RNN -> 53.99
pca + rf -> 54.0575
pca + rnn -> 54.760
autoencoder + rf -> 50.86
autoencoder + rnn -> 52.65
rf + rf -> 70.95
rf + rnn -> 59.52

Can you please confirm these results?

And I still have to run the remaining combinations.
So for the remaining combinations, please tell me their accuracy too. 
It would be a great help. 

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.