Skip to content

A simple tensorflow.js example on predicting sleep efficiency.

Notifications You must be signed in to change notification settings

Shaylin/sleep-efficiency-predictor-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sleep Efficiency Predictor

This project exists to serve as an example on training a neural network in nothing but javascript within your browser.

Utilizing javascript in the browser has the following benefits:

  • Simple dependency management with npm
  • Powerful html & css data visualisations
  • GPU accelerated training through WebGL compute shaders without any extra sdk or driver installation
  • The trained model is ready to deploy any other browser client

The main drawback of this set up is that performance of model training and inference will be slower than running code natively on a computer with something like Node.js or Python. That being said, spending days configuring your Python environment and fiddling with CUDA drivers is also slow 😶‍🌫️.

Objective

This work utilizes the sleep efficiency dataset from kaggle.

While the dataset is quite limited in size and has many methodological issues, it is a good candidate to help us answer the question:

What lifestyle changes should I make to achieve the highest sleep efficiency?

We will first utilize danfo.js to ingest and prepare, and visualize our downloaded data csv.

Tensorflow.js will be used for the training and inference process.

Getting Started

The only software you need is Node.js 18.

To install library dependencies run the following command at the root of the project:

npm install

To work around a bug in the existing version of danfo.js run the following command first:

npm run setup

To execute the project webpage, run the following command:

npm run start

About

A simple tensorflow.js example on predicting sleep efficiency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published