Home Applications Sheep’s Galaxy

Sheep’s Galaxy

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
2
1 reviews
2
Awards
398
Views
0
IPM installs
1
1
Details
Releases
Reviews
Awards
Issues
Pull requests
Videos
Articles
This app has a demo View
Example of using InterSystems IRIS Cloud SQL and IntegratedML

What's new in this version

add a video link to readme

Sheep’s Galaxy

About

This project demonstrates an application for sleep quality monitoring and analysis.
Client side: TypeScript with Angular framework.
Server side: Python with FastAPI and DB-API to connect to the database.
Database: The database is hosted in InterSystems IRIS Cloud SQL, and we used one of its features, IntegratedML, to predict sleep quality.

Quick start

Execute the following commands in the terminal to start the project:

git clone https://github.com/banksiaglobal/SleepTracker
docker compose up -d --build

The application backend is available at http://localhost:9000/

The application frontend is available at http://localhost:8080/

InterSystems IRIS Cloud SQL

To do this, set up a deployment in the IRIS Cloud SQL portal and write the connection parameters into docker-compose file in the environment section.

Filling with data

The "sleeps" table of our database is populated with the generated data. To do this, send a request to the server:

  1. create tables
http://localhost:9000/utils/create
  1. generate data
http://localhost:9000/utils/generate

*The body of each request must contain the following fields:

  1. url - url database
  2. password - password of database

IntegratedML

The following sql queries are required to implement machine learning algorithms:

Create model sleep predicting (quality) from SQLUser.Sleeps
Train model sleeps

Here we create a machine learning model based on the Sleeps database table. For prediction, we specify the field “quality” (“quality of sleep”, the user’s sensation after sleep).

As a result of training, we get prediction and probability_quality fields, which we use later, for example, in such a sql query:

SELECT PREDICT(sleeps use sleeps) as prediction, quality,
PROBABILITY(sleeps use sleeps for '3') as probability_quality, * FROM SQLUser.Sleeps
where user_id = 1 and id = 1

where the prediction field contains a prediction of the quality of sleep, the probability_quality field contains the probability that the dream will be “qualitative” based on its entered characteristics.

Application demonstration

angular-web

Video

youtube

Thanks!

Developers of project:

Made with
Version
1.0.721 Apr, 2023
Category
Technology Example
Works with
InterSystems IRIS Cloud SQL
First published
16 Apr, 2023