Commit 9f877c24 authored by Serasinghe K.A.E.Y.D's avatar Serasinghe K.A.E.Y.D 😊

Merge branch 'yomal-dev' into 'master'

Yomal dev

See merge request !8
parents af128846 97254e2d
from inference import *
from flask_cors import CORS
from flask import Flask, Response, request
from flask import Flask, Response, jsonify, request
from pymongo import MongoClient
import threading
import requests
import schedule
# import schedule
import time
import random
from datetime import datetime
from mongodb_api import *
app = Flask(__name__)
CORS(app)
def risk():
risk_level, HeartRateArr, BloodOxygenLevelArr, BodyTemperatureArr = risk_level_prediction()
if risk_level == "Risky":
requests.get('http://localhost/api/risk-alert')
print(risk_level)
def diwo():
exercise_plan, diet_plan, HeartRateArr, BloodOxygenLevelArr, BodyTemperatureArr = diet_workout_prediction()
print(diet_plan)
def update_risk_level():
while True:
risk()
time.sleep(120)
def update_diet_plan():
# schedule.every().day.at("19:05:00").do(diwo)
while True:
diwo()
# schedule.run_pending()
time.sleep(60)
thread1 = threading.Thread(target=update_risk_level)
thread1.start()
print("test")
thread2 = threading.Thread(target=update_diet_plan)
thread2.start()
print("test")
@app.route('/inference', methods=['POST'])
def perform_inference():
data = request.json.get('data')
data = json.loads(data)
print(data)
api_data = data
# Perform inference and get the result
result = get_Android_data(api_data)
print(result)
if result == "Patient has dementia":
# Return a specific response for dementia case
return jsonify({'message': 'This patient has dementia.'})
else:
# Return a specific response for non-dementia case
return jsonify({'message': 'This patient does not have dementia.'})
@app.route('/record', methods=['POST'])
def record():
......@@ -35,8 +80,8 @@ def record():
spo2 = data['spo2']
# temperature = random.uniform(29, 38)
# temperature = round(temperature, 2)
# bpm = random.randint(60, 100)
# spo2 = random.randint(80, 110)
bpm = random.randint(60, 100)
spo2 = random.randint(80, 110)
print(temperature, bpm, spo2)
health_collection = db['health']
health_document = {
......@@ -65,6 +110,3 @@ if __name__ == "__main__":
threaded=False,
use_reloader=True
)
import json
import pickle
import numpy as np
import pandas as pd
import tensorflow as tf
from math import sin, cos, sqrt, atan2, radians, asin
from pymongo import MongoClient
from datetime import datetime
try:
client = MongoClient(
"mongodb+srv://eshan:78NCxoxRgTBQAVyg@health.7yovxrt.mongodb.net/?retryWrites=true&w=majority")
# client = MongoClient(
# "mongodb+srv://admin:admin@early-detection.jevtz.mongodb.net/")
db = client["Heal"]
client.server_info()
print("DB accessed !")
except Exception as e:
print("*************************************************************")
print(e)
print("*************************************************************")
##################################### PARAMS #########################################
risk_level_mapping = {
0: "situation doesn't exist",
1: "Manageable",
2: "Normal Healthy",
3: "Risky"
}
excercise_plan_mapping = {
1: '''{"plan": "No exercises", "exercise": "Reading,Solving puzzles,Art and Craft,Mindful Relaxation"}''',
0: '''{"plan": "Low Risk Exercises", "exercises": " Walking,Seated Leg Lifts,Wall Push-Ups,Neck Stretches,Deep Breathing Exercises"}''',
2: '''{"plan": "Low to Moderate Risk Exercises", "exercises": "Tai Chi,Water Aerobics,Yoga,Stationary Biking,Resistance Band Exercises"}''',
3: '''{"plan": "Moderate to High Risk Exercises", "exercises": "Extreme Heat Yoga,High-Impact Sports,Advanced Martial Arts,High-Intensity Dance Workouts,Rapid or Excessive Stretching,Acrobatics"}'''
}
diet_plan_mapping = {
1: '''{"plan": "No food plan"}''',
0: '''{"plan": "Low Cholesterol Food", "breakfast": "Vegetable roti (flatbread filled with a mix of grated vegetables) with a side of fresh fruit. Egg hoppers (appa) with a side of tomato and cucumber salad. Rava upma (semolina cooked with vegetables) with a side of fresh fruit. Oatmeal topped with sliced almonds and fresh berries.", "lunch": "Grilled fish curry with tempered green beans and steamed red rice. Lentil curry (parippu) with tempered spinach and brown rice. Sambar (lentil and vegetable stew) with brown rice and a cucumber salad. Grilled vegetable wrap with whole wheat tortilla, hummus, and avocado.", "dinner": "Stir-fried chicken and vegetable curry with quinoa. Grilled shrimp skewers with mixed vegetable stir-fry and red rice. Millet dosa with tomato chutney and a mixed vegetable curry. Baked chicken breast with quinoa and steamed asparagus"}''',
2: '''{"plan": "Balanced Diet with All Nutrients", "breakfast": "Coconut milk rice (kiribath) with lunu miris (spicy onion sambol) and boiled eggs. String hoppers (idiyappam) with dhal curry and coconut chutney. Greek yogurt with granola, banana slices, and a drizzle of honey. Idli (steamed rice cakes) with coconut chutney and sambar.", "lunch": "Chicken curry with a side of mixed vegetable curry and quinoa. Fish ambul thiyal (sour fish curry) with red rice and gotu kola salad. Quinoa salad with mixed vegetables (cucumbers, tomatoes, bell peppers) and a lemon-tahini dressing. Vegetable biryani with cucumber raita and a side of mixed vegetable kurma", "dinner": "Eggplant curry with coconut roti and a cucumber and tomato salad Mixed vegetable kottu roti with a side of chicken curry. Channa masala (spiced chickpea curry) with roti and a spinach salad. Grilled lean steak with roasted potatoes, sautéed kale, and a side of mixed beans."}''',
3: '''{"plan": "Hot Beverages & Meals Rich in Potassium", "breakfast": "Spiced tea (Ceylon tea with spices like cinnamon and cardamom) with string hoppers and coconut sambol. Coconut water with hopper pancakes (appa) and lunu miris (spicy onion sambol). Banana and spinach smoothie with almond milk, chia seeds, and a pinch of cinnamon. Masala chai with medu vada (lentil fritters) and coconut chutney.", "lunch": "Jackfruit curry with basmati rice and a side of tempered spinach. Chicken curry with potato and green bean curry, served with red rice. Lentil soup with carrots, celery, and a squeeze of lemon juice Avial (mixed vegetable curry in coconut gravy) with adai (mixed lentil dosa) and a beetroot poriyal.", "dinner": " Lentil soup with pumpkin and a side of papadums Beetroot curry with coconut milk rice(kiribath) and a cucumber salad. Baked cod with steamed brown rice, roasted Brussels sprouts, and a sprinkle of sesame seeds. Tomato rasam(spicy tomato soup) with lemon rice and a spinach poriyal"}'''
}
##################################### LOAD MODELS #########################################
risk_model = tf.keras.models.load_model('weights/future_prediction.h5')
risk_model.compile(
optimizer='adam',
loss='categorical_crossentropy',
metrics=[
tf.keras.metrics.CategoricalAccuracy(),
tf.keras.metrics.Precision(),
tf.keras.metrics.Recall(),
tf.keras.metrics.AUC()
])
with open('weights/scalar_future_prediction.pkl', 'rb') as f:
risk_scalar = pickle.load(f)
diet_workout_model = tf.keras.models.load_model(
'weights/diet_workout_prediction.h5')
diet_workout_model.compile(
loss='sparse_categorical_crossentropy',
optimizer='adam',
metrics=['accuracy']
)
with open('weights/scalar_diet_workout_prediction.pkl', 'rb') as f:
diet_workout_scalar = pickle.load(f)
##################################### PREDICTION #########################################
def risk_level_prediction():
health_collection = db["health"]
health_data = pd.DataFrame(list(health_collection.find()))
sample_data = health_data[-50:][["HeartRate",
"BloodOxygenLevel", "BodyTemperature"]]
# sample_data = health_data.sample(
# frac=50/len(health_data))[["HeartRate", "BloodOxygenLevel", "BodyTemperature"]]
HeartRateArr = sample_data["HeartRate"].values.tolist()
BloodOxygenLevelArr = sample_data["BloodOxygenLevel"].values.tolist()
BodyTemperatureArr = sample_data["BodyTemperature"].values.tolist()
Xinf = sample_data.values
Xinf = risk_scalar.transform(Xinf)
Xinf = Xinf.reshape(1, 50, 3)
risk_level = risk_model.predict(Xinf).squeeze()
risk_level = np.argmax(risk_level)
risk_level = risk_level_mapping[risk_level]
risk_level_collection = db['risk_level']
risk_level_document = {
"risk_level": risk_level,
"created_at": datetime.now(),
"updated_at": datetime.now()
}
risk_level_collection.insert_one(risk_level_document)
return risk_level, HeartRateArr, BloodOxygenLevelArr, BodyTemperatureArr
def diet_workout_prediction():
health_collection = db["health"]
health_data = pd.DataFrame(list(health_collection.find()))
sample_data = health_data[-50:][["HeartRate",
"BloodOxygenLevel", "BodyTemperature"]]
HeartRateArr = sample_data["HeartRate"].values.tolist()
BloodOxygenLevelArr = sample_data["BloodOxygenLevel"].values.tolist()
BodyTemperatureArr = sample_data["BodyTemperature"].values.tolist()
Xinf = sample_data.values
Xinf = diet_workout_scalar.transform(Xinf)
exercise_plan_idxs, diet_plan_idxs = diet_workout_model.predict(Xinf)
exercise_plan_idxs = exercise_plan_idxs.squeeze()
diet_plan_idxs = diet_plan_idxs.squeeze()
exercise_plan_idxs = np.argmax(exercise_plan_idxs, axis=1)
diet_plan_idxs = np.argmax(diet_plan_idxs, axis=1)
exercise_plans = [excercise_plan_mapping[idx]
for idx in exercise_plan_idxs]
diet_plans = [diet_plan_mapping[idx] for idx in diet_plan_idxs]
mode_exercise_plan = max(set(exercise_plans), key=exercise_plans.count)
mode_diet_plan = max(set(diet_plans), key=diet_plans.count)
diet_plan_collection = db['diet_plan']
diet_plan_document = {
"diet_plan": mode_diet_plan,
"created_at": datetime.now(),
"updated_at": datetime.now()
}
diet_plan_collection.insert_one(diet_plan_document)
exercise_plan_collection = db['exercise_plan']
exercise_plan_document = {
"exercise_plan": mode_exercise_plan,
"created_at": datetime.now(),
"updated_at": datetime.now()
}
exercise_plan_collection.insert_one(exercise_plan_document)
return mode_exercise_plan, mode_diet_plan, HeartRateArr, BloodOxygenLevelArr, BodyTemperatureArr
def haversine(p1, p2):
lat1, lon1 = p1
lat2, lon2 = p2
lat1 = float(lat1)
lon1 = float(lon1)
lat2 = float(lat2)
lon2 = float(lon2)
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
# Radius of earth in kilometers. Use 3956 for miles. Determines return value units.
r = 6371
distance_km = c * r
return distance_km
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Diabetic,AlcoholLevel,Weight,MRI_Delay,HeartRate,BloodOxygenLevel,BodyTemperature,Dementia
0,0.02,85,8,74,91.4,36.15,0
1,0.03,61,7,74,95.05,36.04,0
1,0.12,85,26,60,97.59,36.24,1
1,0.15,77,25,81,91.02,36.57,1
1,0.31,55,24,89,95.36,37.46,1
0,0.28,96,19,72,97.05,36.07,0
1,0.49,79,28,66,93.8,36.68,1
0,0.19,76,22,77,97.02,37.03,0
0,0.27,81,6,89,93.79,37.48,0
1,0.42,57,8,62,98.05,36.6,0
0,0.46,90,7,91,93.96,37.37,1
0,0.14,81,24,95,95.39,37.12,1
1,0.19,67,17,91,90.91,36.07,0
0,0.32,104,20,64,93.85,36.89,1
1,0.49,51,22,67,96.82,36.81,1
1,0.06,105,6,89,90.03,37.08,1
0,0.26,63,28,100,92.98,36.96,0
0,0.19,70,18,93,99.18,36.9,1
0,0.06,96,29,79,92.39,36.36,0
0,0.37,58,25,94,97.66,36.19,1
0,0.14,104,7,94,97.55,37.03,1
1,0.5,97,15,93,94.51,36.37,0
1,0.02,120,8,97,92.2,36.11,0
0,0.04,54,28,81,90.71,36.36,1
0,0.27,110,8,90,98.07,36.29,0
1,0.18,102,15,63,96.73,37.48,0
0,0.21,93,26,66,92.49,36.29,1
0,0.22,85,15,75,98.74,36.11,0
0,0.33,119,27,60,99.69,37.39,0
0,0.21,111,7,85,99.02,36.25,0
1,0.14,108,10,87,96.97,37.1,1
0,0.1,77,2,97,97.36,36.09,1
0,0.03,111,17,93,91.57,37.44,0
0,0.04,58,22,75,94.04,37.41,0
0,0.31,103,22,97,95.65,36.47,1
0,0.34,90,8,76,93.96,37.01,1
1,0.16,59,1,89,96.21,36.84,0
0,0.27,114,9,68,99.33,37.32,0
1,0.15,106,27,94,97.04,36.92,0
1,0.47,63,29,68,92.64,37.33,0
1,0.15,76,23,81,92.04,36.95,1
1,0.13,56,3,100,94.24,36.42,0
1,0.39,83,6,88,95.52,36.64,0
0,0.05,69,18,62,98.35,36.87,0
1,0.07,89,12,62,98.99,36.32,0
0,0.18,102,20,69,99.26,36.36,0
0,0.44,53,6,81,97.82,36.62,0
1,0.09,63,13,62,98.59,36.33,1
1,0.16,79,8,61,96.6,36.6,1
0,0.48,85,12,92,94,37.47,1
0,0.07,83,6,97,99.63,36.4,0
1,0.18,90,14,98,99.84,36.17,0
1,0.03,105,1,93,99.26,36.81,0
1,0.22,92,20,80,96.63,36.19,1
1,0.34,91,13,78,95.54,36.29,1
0,0.31,88,13,95,98.34,36.46,0
1,0.4,91,15,88,94.42,36.32,1
0,0.33,86,17,100,96.19,36.14,0
1,0.12,75,5,61,90.46,37.48,0
1,0.21,74,23,84,94.94,36.37,0
0,0.39,78,6,93,94.65,36.84,0
1,0.08,109,22,93,99.88,36.89,1
1,0.42,120,15,70,97.44,36.71,1
0,0.42,85,25,93,94.85,36.36,1
0,0.36,80,9,81,93.2,36.81,0
0,0.12,69,23,73,90.64,36.61,1
1,0.04,103,13,97,99.46,36.03,1
1,0.01,95,10,84,98.53,37.43,1
0,0.25,84,14,91,90.29,36.5,1
0,0.42,66,20,94,90.27,36.59,0
0,0.32,67,28,89,91.82,36.39,1
0,0.23,93,25,84,92.78,37.43,1
1,0.42,110,1,94,90.52,37.43,0
0,0.39,55,25,61,99.5,36.3,0
0,0.13,110,22,67,95.64,36.33,1
1,0.09,64,25,70,99.65,36.16,0
1,0.29,98,13,72,90.76,37.04,0
0,0.35,88,28,98,98.06,37.19,0
1,0.27,97,3,92,96.48,36.02,1
1,0.06,96,21,89,97.07,36.65,1
1,0.24,84,11,75,98.31,36.13,1
0,0.38,98,11,61,94.94,36.49,1
0,0.18,83,11,77,98.8,37.05,1
0,0.26,74,3,75,97.2,36.73,0
1,0.33,112,15,61,90.93,36.33,0
1,0.34,97,16,95,95.31,36.64,1
1,0.35,84,10,76,92.31,37.08,1
0,0.37,73,7,73,97.39,36.41,1
0,0.42,87,8,83,91.79,36.02,0
1,0.03,56,18,78,96.97,36.19,1
0,0.44,86,16,90,94.4,36.28,0
1,0.47,111,4,64,94.01,36.11,0
0,0.08,88,3,75,91.18,37.15,0
1,0.23,106,10,97,99.9,36.46,0
0,0.47,76,21,73,92.65,36.12,0
0,0.28,70,1,86,94.51,36.89,1
0,0.12,86,23,89,90.71,36.35,1
0,0.22,119,8,69,99.08,37.24,0
0,0.09,89,20,96,99.21,36.66,1
1,0.35,84,17,94,94.94,36.12,0
1,0.37,82,1,65,92.29,37.01,0
1,0.29,72,16,93,96.52,37.37,0
1,0.32,112,3,90,93.48,36.5,0
0,0.17,113,10,85,98.14,36.83,1
0,0.16,91,4,85,98.65,37.24,0
1,0.21,74,17,83,96.23,36.75,1
0,0.11,120,5,78,94.38,37.05,0
0,0.49,80,23,70,93.11,36.02,1
0,0.12,64,15,67,96.48,36.23,1
1,0.21,111,16,75,94.57,36.22,0
0,0.43,85,25,86,93.4,37.18,1
0,0.15,88,27,97,95.8,36.99,0
1,0.27,94,11,95,97.63,36.57,1
0,0.49,80,19,84,92.34,37.16,0
1,0.37,98,13,69,94.95,36.06,1
0,0.44,106,4,93,99.1,36.02,0
1,0.44,69,3,90,97.82,36.4,1
0,0.43,118,13,80,96.27,37.33,1
0,0.31,80,21,78,99.97,37.12,1
0,0.38,62,15,70,96.94,37.36,0
1,0.4,87,12,83,94.31,36.37,1
0,0.09,60,20,84,96.2,36.36,0
0,0.24,82,15,76,96.67,37.35,1
1,0.34,70,3,88,99.45,37.48,1
1,0.35,108,28,79,91.99,36.58,1
0,0.13,95,19,78,99.93,36.44,1
1,0.01,56,30,98,97.45,37.25,1
0,0.31,95,8,100,91.9,36.38,0
0,0.45,55,10,88,90.33,36.55,0
0,0.46,91,24,86,91.76,36.2,1
1,0.42,82,30,90,99.67,36.44,1
0,0.24,59,5,74,98.6,37.09,1
1,0.05,100,1,76,95.37,36.68,1
1,0.41,97,4,74,94.71,36.93,1
0,0.33,109,30,79,96.49,36.18,0
0,0.16,113,4,66,92.35,36.81,1
1,0.19,119,14,97,97.42,36.23,1
0,0.42,102,9,62,96.9,36.33,1
0,0.43,62,22,83,95.44,37.47,1
0,0.21,74,4,89,90.92,36.32,0
0,0.4,81,5,96,92.05,37.24,0
0,0.41,79,11,69,97.89,36.89,1
0,0.49,119,9,71,91.1,37.3,0
0,0.19,80,19,80,90.16,36.4,0
1,0.27,58,16,88,97.78,36.77,0
1,0.26,55,24,93,93.02,36.97,0
0,0.5,101,14,66,94.9,37.36,0
0,0.17,68,3,68,92.75,36.95,1
1,0.5,117,10,89,95.06,36.65,0
0,0.22,79,14,81,98.27,36.6,0
1,0.22,82,12,69,96.87,36.71,0
0,0.06,62,24,83,98.12,36.83,1
0,0.21,104,28,63,99.68,36.9,1
0,0.29,77,5,90,92.24,36.16,1
0,0.38,78,26,87,98.45,37.46,0
1,0.02,84,23,79,99.22,36.53,0
0,0.29,101,3,69,97.41,37.46,0
0,0.19,108,11,70,93.7,37.08,0
0,0.09,56,22,65,92.72,36.99,1
1,0.21,77,25,92,91.14,36.64,1
1,0.27,89,2,74,93.95,36.9,0
0,0.16,77,25,68,97.64,36.43,0
0,0.25,105,6,68,93.8,37.06,1
0,0.2,55,14,61,94.6,36.12,1
1,0.29,103,10,67,94.05,37.45,0
1,0.42,96,3,87,98.44,36.36,1
0,0.2,89,24,81,92.22,37.17,0
0,0.27,74,29,82,93.51,37.44,0
0,0.06,82,7,71,96.02,37.14,0
0,0.48,113,15,96,97.6,36.67,1
1,0.08,58,16,88,96.31,37.19,0
1,0.26,89,15,88,90.38,36.55,1
0,0.33,61,20,98,95.07,36.69,0
1,0.46,74,11,98,94.76,36.23,0
1,0.06,93,23,65,95.05,36.26,0
1,0.5,117,17,99,91.59,36.56,1
1,0.21,93,22,98,90.52,36.95,1
0,0.17,99,10,76,97.24,36.98,0
1,0.05,68,30,82,93.1,36.98,1
0,0.3,60,10,95,93.77,37.19,0
0,0.33,104,17,83,90.18,36.46,0
1,0.47,112,7,74,100,36.23,1
0,0.26,119,27,93,90.38,36.51,0
1,0.09,73,27,99,98.09,36.25,1
0,0.21,80,15,99,92.85,37.12,1
0,0.27,89,26,90,99.04,36.29,1
1,0.39,98,17,93,94.19,36.24,0
0,0.44,56,21,90,98.74,36.83,0
0,0.15,70,9,88,99.05,36.22,1
0,0.47,78,27,88,98.85,37.4,1
0,0.2,97,8,84,99.95,36.56,0
1,0.47,92,26,69,91.38,36.43,1
0,0.38,110,15,99,90.05,36.12,1
0,0.42,120,24,98,95.28,36.17,1
0,0.16,56,8,86,96.39,36.93,0
0,0.42,113,20,94,90.16,36.77,0
0,0.15,50,20,82,92.41,36.62,0
1,0.04,117,18,92,97.86,36.76,0
1,0.44,55,21,84,99.81,36.38,0
1,0.4,94,8,100,91.04,36.87,1
0,0.03,119,11,71,98.3,37.03,1
0,0.41,58,23,89,90.37,36.3,0
0,0.16,89,17,85,99.89,36.81,1
0,0.38,74,10,82,98.62,36.07,1
1,0.07,97,14,85,97.43,37.34,1
1,0.49,113,23,91,93.67,37.2,1
0,0.37,60,14,98,99.95,36.27,1
1,0.06,91,22,78,93.06,36.9,1
0,0.35,94,15,62,97.27,37.37,1
1,0.32,57,3,100,94.06,36.77,0
0,0.08,106,2,68,90.67,37.17,1
1,0.2,54,20,69,96.79,37.42,1
1,0.38,67,17,83,93.98,36.97,0
0,0.02,73,16,93,93.87,36.84,1
1,0.35,77,20,78,96.94,37.5,0
0,0.08,59,15,71,98.99,36.67,0
1,0.34,58,18,94,92.9,36.45,0
0,0.4,115,8,67,99.85,37.19,0
1,0.02,120,19,83,94.67,37.47,0
0,0.04,100,23,90,95.26,37.15,0
0,0.49,59,15,89,96.8,36.52,0
0,0.22,57,27,67,95.18,36.46,0
1,0.47,78,12,93,98.95,37.27,1
0,0.32,120,9,68,96.25,36.92,0
0,0.3,69,6,99,97.21,36.91,0
0,0.05,83,21,73,97.67,36.62,0
1,0.45,119,10,79,94.83,37.21,1
1,0.23,57,6,88,94.16,36.7,1
0,0.16,90,24,82,99.75,36.2,1
0,0.17,109,4,77,94.5,36.21,0
1,0.47,103,8,70,98.13,37.4,1
0,0.38,113,17,89,94.99,36.46,0
0,0.47,114,15,75,92.15,36.53,0
1,0.25,110,10,94,90.08,36.16,0
1,0.37,101,12,62,94.01,36.86,0
1,0.28,59,13,92,94.5,36.82,0
0,0.49,100,12,81,95.58,36.55,0
0,0.31,101,17,62,90.45,36.21,1
1,0.26,69,20,92,91.4,37.4,1
0,0.2,88,19,81,95.07,36.76,1
1,0.24,52,12,81,96.74,37.47,1
0,0.3,83,21,97,95.78,37.08,1
0,0.27,98,5,75,90.32,37.42,0
0,0.02,90,14,69,94.13,36.31,1
0,0.36,116,7,95,93.25,36.99,1
1,0.48,108,30,94,93.42,36.53,1
1,0.1,81,9,95,92.98,37.41,1
1,0.36,112,11,90,93.49,37.4,1
1,0.07,119,13,85,98.18,37.43,0
1,0.03,60,12,88,96.56,37.12,0
0,0.42,84,30,95,96.96,36.21,0
0,0.03,117,8,100,92.33,36.15,1
1,0.06,67,1,95,99.78,36.24,1
1,0.33,86,11,78,96.46,37.36,0
0,0.27,54,30,71,94.18,37.26,0
1,0.4,73,30,78,98.77,36.01,0
1,0.15,119,17,91,98.89,36.2,1
1,0.1,64,11,70,97.31,36.97,0
0,0.37,87,19,72,91.75,37.28,1
1,0.26,61,13,66,91.85,36.21,1
0,0.01,99,8,88,97.54,37.43,1
0,0.14,96,23,75,90.62,36.18,1
0,0.21,114,30,79,96.9,36.96,1
1,0.31,78,5,90,91.53,37.12,1
1,0.35,110,25,94,98.02,37.24,0
0,0.27,117,23,83,90.78,36.85,0
0,0.29,69,6,80,98.54,36.66,0
1,0.05,115,15,63,94.53,36.77,1
0,0.28,89,24,61,93.96,37.22,0
0,0.03,94,23,64,95.41,36.09,0
1,0.03,102,6,68,97.66,37.47,1
1,0.5,98,15,84,93.76,37.02,0
1,0.07,118,13,93,91.27,37.47,0
0,0.49,109,22,94,94.24,36.57,0
0,0.24,69,9,72,99.37,37.09,0
0,0.41,103,20,61,92.41,36.1,0
1,0.3,56,8,62,94.02,36.35,0
0,0.08,87,8,96,93.19,36.9,1
0,0.16,68,22,93,92.21,36.45,0
0,0.32,104,18,91,90.47,36.52,1
1,0.35,102,5,79,93.76,37.13,1
0,0.43,88,28,69,98.06,37.37,1
1,0.28,67,13,75,92.55,36.5,0
1,0.43,61,18,72,90.52,36.57,0
0,0.1,77,16,73,98.69,36.5,0
0,0.47,65,24,90,99.14,37.04,0
1,0.46,120,11,78,93.81,36.8,1
1,0.14,115,29,91,94.66,37.2,1
1,0.46,97,11,86,90.46,37.3,0
0,0.14,103,10,69,91.96,36.35,0
1,0.28,93,9,91,99.67,36.96,1
1,0.09,95,6,68,97.2,36.73,0
0,0.42,59,27,63,97.64,36.62,0
0,0.36,51,7,92,94.56,36.09,1
1,0.02,118,18,86,90.12,36.79,1
1,0.02,105,26,71,91.07,36.14,0
0,0.1,117,9,82,92.67,36.6,1
1,0.23,81,23,74,93,37.24,0
0,0.06,98,13,95,94.76,36.96,0
0,0.25,105,21,81,95.66,37.29,0
0,0.12,110,9,62,99.24,37.03,1
0,0.1,90,1,73,95.87,37.13,1
0,0.16,80,19,84,96.77,36.81,1
0,0.4,60,17,82,90.54,36.66,0
1,0.31,100,25,80,90.3,36.41,1
1,0.12,120,13,87,91.86,36.88,1
0,0.39,87,26,75,97.13,36.12,0
1,0.36,69,24,84,93.17,36.16,0
1,0.23,84,4,68,90.87,36.65,1
0,0.02,95,18,65,95.97,37.18,1
0,0.15,99,25,65,97.25,36.84,0
0,0.35,71,5,77,93.01,36.74,0
0,0.22,103,10,90,97.83,36.54,0
1,0.3,75,15,66,91.35,36.01,1
1,0.42,98,26,81,94.4,36.65,0
1,0.17,75,16,80,91.78,36.6,1
1,0.37,112,19,75,93.26,36.42,1
1,0.07,75,19,94,91.8,37.15,0
1,0.47,76,15,78,98.31,36.1,1
1,0.08,88,8,76,96.59,37.07,1
0,0.23,111,19,85,95.34,37.39,1
0,0.4,96,23,94,95.94,37.37,0
0,0.33,95,6,99,90.44,37.48,1
1,0.48,105,4,60,90.99,36.33,0
1,0.19,109,25,97,96.9,36.23,0
1,0.06,103,30,65,91.16,37.41,0
1,0.16,108,26,73,95.21,36.52,0
1,0.36,107,11,64,93,37.22,0
0,0.43,63,22,70,99.3,37.11,0
0,0.17,104,15,74,97.98,36.94,0
1,0.2,75,15,97,94.3,36.01,0
0,0.15,58,19,66,98,36.81,1
1,0.11,64,9,91,95.28,36.96,1
1,0.3,94,12,89,96.17,37.22,1
0,0.34,90,4,75,93.05,36.27,0
1,0.21,67,19,84,94.23,36.73,0
0,0.25,67,6,80,98.42,36.93,1
0,0.25,74,27,84,99.64,36.76,1
1,0.35,103,23,88,94.89,36.12,0
0,0.15,85,8,94,92.89,37.17,1
0,0.29,84,25,94,98.23,36.55,0
1,0.28,104,4,75,92.98,37.5,1
1,0.18,61,15,67,97.76,36.36,1
1,0.09,67,26,73,98.14,37.21,1
1,0.3,71,11,78,92.89,36.4,0
0,0.48,102,30,63,99.92,37.3,0
0,0.13,91,27,75,97.61,37.01,1
0,0.29,84,21,86,93.75,36.11,0
1,0.26,85,23,83,94.55,36.73,0
0,0.37,108,21,82,98.5,37.19,1
0,0.48,77,16,77,93.23,36.43,0
1,0.4,56,2,66,96.26,37.26,0
0,0.47,70,15,89,90.01,37.44,0
0,0.44,88,6,77,90.93,36.54,0
1,0.34,71,2,85,96.26,37.09,0
1,0.33,62,1,73,94.77,36.2,0
1,0.01,93,27,67,99.88,36.63,0
1,0.04,99,3,66,91.03,36.55,1
0,0.2,67,21,69,90.68,36.84,0
1,0.18,77,21,69,99.2,36.92,1
0,0.05,62,5,67,95.9,36.58,1
1,0.4,81,9,65,92.48,36.9,1
0,0.43,88,7,93,96.07,36.28,1
1,0.33,80,16,84,91.13,36.75,0
0,0.49,90,5,84,98.61,36.85,1
0,0.38,59,1,97,90.68,36.39,0
0,0.47,100,17,78,96.29,36.75,1
1,0.35,60,21,94,95.38,36.23,0
1,0.05,76,26,69,95.36,36.59,0
1,0.35,80,2,75,90.86,36.65,1
0,0.16,72,4,60,97.08,37.05,0
1,0.48,116,17,76,91.67,36.19,1
0,0.39,53,11,87,92.72,36.1,0
1,0.23,96,2,91,98.59,36.25,0
1,0.39,64,8,92,90.03,37.29,0
0,0.03,96,13,69,91.79,37.44,0
1,0.12,81,14,80,92.71,36.12,1
0,0.26,56,6,74,98.04,37.47,1
0,0.44,86,25,79,93.27,36.83,0
1,0.11,88,24,99,92.43,36.55,1
0,0.37,119,25,75,91.51,37.4,0
0,0.28,51,11,60,97.59,36.56,1
0,0.11,80,14,91,99.61,37.46,0
1,0.06,79,29,93,94.13,37.34,1
0,0.29,114,5,100,98.2,36.11,0
1,0.33,66,8,78,92.61,36.47,1
1,0.17,84,8,64,99.44,36.2,0
0,0.06,107,15,80,94.07,36.8,0
1,0.16,83,28,67,90.9,37.21,1
0,0.12,91,5,65,97.11,37.45,1
0,0.34,83,27,71,90.31,36.61,1
0,0.06,63,26,68,91.21,36.09,0
0,0.11,101,12,100,99.38,36.13,1
0,0.02,58,7,88,98.09,36.14,1
0,0.03,109,2,70,99.24,36.65,1
1,0.02,104,6,82,92.15,36.28,1
1,0.44,54,20,99,96.17,36.97,1
1,0.44,111,2,65,92.8,36.21,0
0,0.32,119,26,61,99.89,37.17,1
1,0.28,112,12,96,95.02,36.58,0
0,0.17,78,1,77,90.59,37.49,1
0,0.49,62,8,75,92.67,37.22,0
0,0.29,99,12,71,91.76,36.89,1
0,0.35,95,19,96,91.42,37.42,1
1,0.1,54,3,63,92.33,36.33,1
0,0.17,75,26,68,93.41,36.27,1
0,0.02,68,25,67,98.46,37.29,0
1,0.36,100,19,66,93.37,36.48,0
1,0.4,112,21,80,91.74,37.45,1
0,0.34,72,13,79,97.34,36.44,0
0,0.47,100,28,96,90.32,36.9,0
0,0.47,68,11,64,92.38,37.47,0
0,0.41,92,15,60,92.65,36.37,0
1,0.14,63,24,60,90.48,36.66,1
0,0.44,113,29,84,93.51,36.56,1
0,0.09,59,26,62,92.95,36.48,0
0,0.18,98,6,64,95.47,37.35,0
1,0.3,111,23,61,94.31,36.98,1
0,0.04,92,7,72,94.09,36.83,1
1,0.16,62,2,85,95.72,37.26,0
0,0.19,104,3,78,98.24,36.94,1
0,0.06,76,6,100,92.92,36.12,0
1,0.39,110,16,76,90.91,36.82,0
1,0.44,97,6,88,90.45,36.66,1
0,0.42,57,5,66,90.86,36.52,1
0,0.28,99,27,93,94.19,36.8,1
0,0.24,60,13,62,95.02,37.35,0
0,0.48,107,6,70,99.72,37.21,0
0,0.22,105,7,100,91.48,36.89,1
0,0.05,100,18,80,98.57,36.78,0
1,0.07,69,5,96,95.88,37.14,0
0,0.29,62,26,78,98.67,37.32,1
1,0.2,112,19,98,94.73,36.26,1
0,0.31,101,2,85,98.9,36.5,0
0,0.38,84,29,83,90.2,37.23,1
1,0.15,112,28,66,99.72,36.34,1
1,0.39,91,9,86,96.05,36.13,1
0,0.46,102,24,91,97.59,37.3,0
0,0.04,114,13,68,97.81,36.79,0
0,0.1,75,27,63,92.49,36.68,1
0,0.14,109,17,85,96.35,36.19,0
0,0.19,107,6,90,95.87,36.52,0
1,0.38,61,10,61,93.87,36.24,0
0,0.33,76,9,86,95.13,37.3,0
1,0.46,72,20,60,92.24,36.91,1
1,0.22,98,28,82,94.59,36.33,1
1,0.3,50,17,83,95.61,36.89,1
1,0.35,111,3,81,99.88,36.96,1
1,0.33,88,7,69,95.17,36.36,0
1,0.33,67,24,61,96.55,37.5,1
1,0.21,54,19,96,98.16,36.51,0
1,0.45,95,17,79,98.45,37.26,0
1,0.06,66,24,76,97.25,36.84,0
1,0.33,78,12,74,97.44,36.46,1
1,0.14,87,15,67,94.71,37.3,0
1,0.45,114,4,84,95.3,36.62,0
0,0.5,93,14,96,98.93,37.48,0
1,0.43,73,25,65,94.88,36.95,0
1,0.32,50,15,77,92.09,37.16,0
1,0.39,61,5,99,94.34,36.64,1
1,0.2,54,18,72,97.31,37.43,1
0,0.02,50,21,75,92.26,37.32,1
0,0.06,114,19,79,91.67,37.24,1
1,0.23,116,20,93,93.38,37.33,0
1,0.5,112,12,72,91.65,37.36,1
0,0.12,66,7,61,95.9,36.25,1
0,0.19,82,25,94,96.23,36.89,0
0,0.33,52,2,67,94.17,36.57,1
1,0.35,76,23,100,90.09,36.63,0
1,0.32,67,14,66,95.12,36.93,1
0,0.39,113,7,98,92,36.39,0
1,0.35,87,6,62,95.48,37.37,1
1,0.12,51,22,65,99.07,37.25,1
0,0.48,115,3,66,99.05,36.97,1
1,0.14,56,4,71,98.74,37.28,1
1,0.22,64,4,62,90.1,36.21,0
1,0.19,106,20,77,98.78,36.14,1
0,0.07,101,15,77,98.36,37.03,1
1,0.33,71,4,68,96.96,36.09,0
0,0.21,111,26,96,96.78,36.27,1
1,0.31,66,16,91,91.13,36.62,0
0,0.14,90,1,93,97.68,36.86,0
1,0.26,62,14,75,94.82,37,1
0,0.42,56,1,70,95.06,36.7,1
0,0.05,112,11,75,93.31,36.42,0
1,0.21,80,3,89,94.44,36.86,0
1,0.23,65,16,61,91.03,36.62,0
0,0.4,88,29,92,95.62,36.98,1
1,0.19,56,27,74,98.44,36.5,1
1,0.36,64,4,74,90.02,36.53,1
1,0.35,55,29,70,94.92,37.23,1
0,0.13,75,7,67,99.3,36.59,1
0,0.36,63,25,86,90.47,36.95,0
1,0.23,114,5,91,90.04,37.1,1
1,0.46,72,23,97,91.74,37.22,0
1,0.33,91,17,84,94.19,36.91,0
1,0.2,93,10,88,98.05,36.21,1
1,0.36,120,21,73,92.01,36.94,1
1,0.46,66,23,71,95.04,37.04,1
0,0.38,111,19,96,99.43,37.07,1
1,0.41,116,4,61,93.81,36.08,0
0,0.14,70,10,76,91.46,36.09,1
0,0.38,54,12,88,91.02,37.3,0
1,0.13,86,23,63,99.26,36.58,1
0,0.02,82,7,99,98.69,37.29,1
0,0.46,97,25,97,95.47,36.91,0
1,0.23,59,6,71,97.35,36.18,0
1,0.15,83,5,70,95.84,36.38,1
1,0.36,69,2,69,99.29,36.9,1
1,0.4,120,12,64,97.84,36.48,0
0,0.27,114,6,86,95.43,36.61,1
0,0.44,92,11,83,92.94,37.43,1
0,0.07,94,15,75,99.04,36.92,0
0,0.34,91,13,67,93.86,36.81,1
0,0.46,97,17,92,94.46,36.07,0
1,0.26,62,6,94,95.33,36.94,0
0,0.43,104,27,66,92.06,37.24,1
0,0.38,69,1,89,97.17,36.06,0
0,0.1,82,18,64,95.75,36.34,1
1,0.2,101,14,80,90.17,37.01,0
0,0.38,55,23,64,93.58,36.75,1
1,0.31,86,25,88,93.81,37.23,0
1,0.09,78,5,85,97.97,37.27,1
0,0.16,97,1,95,98.75,36.21,0
0,0.29,100,18,95,99.47,36.46,1
0,0.21,115,5,70,91.84,36.93,1
0,0.07,56,28,95,94.61,36.82,1
0,0.13,75,24,97,94.87,36.5,0
0,0.06,58,29,72,93.18,36.68,1
0,0.29,96,26,80,99.59,36.25,1
0,0.39,105,9,83,91.34,37.1,1
1,0.23,89,16,95,91.09,36.97,0
1,0.43,67,29,94,91.96,37.1,0
0,0.45,114,21,61,98.13,36.87,0
0,0.28,119,29,94,94.72,37.16,1
1,0.12,87,5,89,95.01,36.14,1
0,0.33,71,25,92,91.4,36.24,0
1,0.47,55,8,91,92.32,36.4,0
0,0.34,116,30,83,93.88,37.38,0
0,0.49,91,4,93,96.34,36.41,1
0,0.19,98,12,97,96.53,37.25,1
1,0.49,78,17,85,93.53,37.3,1
1,0.44,50,17,68,94.4,36.34,1
0,0.08,70,12,98,97.17,36.18,0
1,0.41,64,16,90,94.79,36.89,1
0,0.13,66,19,97,91.61,36.94,0
0,0.04,83,30,71,95.17,36.61,0
1,0.47,77,15,98,99.93,37.3,0
0,0.42,68,26,97,98.2,36.27,1
0,0.36,93,30,89,95.97,36.1,1
1,0.07,52,7,93,98.6,36.76,1
0,0.31,72,16,99,96,37.32,0
0,0.25,66,29,98,95.39,36,1
1,0.19,55,23,93,94.29,37.41,1
1,0.18,62,14,68,92.55,37.15,0
1,0.3,119,14,76,91.89,37.06,0
0,0.26,98,21,73,96.88,36.47,1
0,0.09,82,9,94,94.24,36.55,1
1,0.38,102,18,95,94.82,36.56,1
1,0.49,94,25,85,97.36,37.28,0
0,0.23,70,4,73,95.08,37.18,0
0,0.2,50,26,65,98.23,36.71,1
0,0.04,78,12,65,96.09,37.09,1
1,0.36,57,25,71,96.4,36.66,0
1,0.11,115,17,74,96.15,37.01,1
0,0.33,70,3,77,97.8,36.53,1
1,0.3,116,1,64,99.19,36.82,1
1,0.48,85,8,98,99.63,36.68,1
0,0.14,102,17,66,95.59,36.75,1
0,0.4,82,29,94,98.13,36.86,1
1,0.29,81,25,81,99.61,36.69,1
0,0.25,83,3,84,96.34,37.49,0
1,0.21,95,17,94,90.1,37.25,0
1,0.06,93,3,95,99.31,36.71,1
0,0.45,84,6,72,94.99,36.3,0
1,0.11,75,27,75,98.36,36.53,0
0,0.46,113,20,60,97.64,36.81,0
1,0.19,90,16,96,98.69,36.74,1
1,0.12,66,2,93,97.99,36.72,0
1,0.2,72,15,67,96.98,36.69,0
0,0.34,98,19,66,93.25,36.92,1
0,0.28,80,9,90,99.59,36.51,0
1,0.22,103,23,83,93.65,36.6,1
0,0.29,79,27,66,97.21,37.21,1
1,0.11,69,16,60,91.77,36.75,1
1,0.16,56,13,66,96.91,36.09,1
1,0.42,62,15,81,92.6,36.54,1
1,0.02,65,12,98,91.99,36.86,0
1,0.18,115,16,88,98.9,36.57,1
1,0.32,68,28,70,96.41,37.39,1
1,0.43,59,3,70,93.44,36.47,1
1,0.31,100,9,88,97.81,37.41,1
1,0.09,52,5,75,96.62,37.41,0
0,0.09,63,4,64,99.37,36.71,0
0,0.39,117,25,65,91.04,36.93,0
1,0.16,81,24,78,94.43,36.19,0
0,0.03,95,28,80,98.64,36.7,1
1,0.08,119,6,97,95.98,36.95,1
1,0.46,111,18,74,98.05,36.66,1
1,0.14,88,1,60,95.23,37.14,0
1,0.15,118,1,91,99.47,36.72,0
1,0.4,79,26,60,95.48,36.28,1
1,0.13,99,27,84,92.21,36.12,0
1,0.15,118,26,77,94.13,37.28,0
0,0.15,108,20,88,92.72,36.93,0
1,0.02,56,18,61,91.86,36.15,1
0,0.36,51,8,65,91.51,36.74,1
1,0.16,113,12,89,96.97,36.05,0
0,0.04,100,3,94,94.7,36.29,1
1,0.42,65,25,75,93.85,37.46,0
0,0.11,62,17,73,94.73,37.02,1
1,0.09,55,24,95,95.21,36.38,1
0,0.19,56,28,73,99.73,36.35,1
1,0.02,85,19,67,93.96,36.36,0
1,0.35,69,12,65,92.49,36.75,1
0,0.04,69,23,94,97.91,36.19,0
1,0.49,94,26,88,97.33,36.03,1
1,0.36,82,29,62,94.85,36.66,1
1,0.1,73,18,82,93.24,36.7,0
0,0.27,107,10,76,95.42,36.68,1
0,0.44,96,25,99,92.39,37.08,1
0,0.27,113,25,95,91.54,36.42,1
1,0.06,116,22,64,90.44,37.41,0
0,0.11,112,7,66,90.32,36.96,1
1,0.27,82,2,83,92.21,37.08,0
0,0.33,60,15,100,90.61,36.84,1
1,0.4,57,27,99,92.66,36.06,0
1,0.05,77,17,66,91.01,36.35,1
0,0.1,81,19,100,99.48,36.84,1
0,0.39,95,22,89,97.03,36.64,0
0,0.4,120,13,92,93.38,36.24,1
1,0.45,120,11,83,94.12,36.95,1
0,0.29,77,13,95,99.26,36.38,1
1,0.48,50,24,62,99.83,36.89,0
1,0.01,78,7,80,90.22,37.23,1
0,0.06,108,12,69,91.38,36.55,0
0,0.14,88,3,96,94,37.38,0
1,0.4,72,16,96,98.2,36.14,1
0,0.37,98,3,63,99.22,36.5,1
1,0.47,65,28,74,97.48,37.27,0
1,0.04,117,2,80,95.4,36.22,0
0,0.03,100,15,98,95.75,36.14,1
1,0.4,68,5,81,90.83,36.86,0
1,0.14,101,17,87,97.74,36.2,0
1,0.28,112,13,96,91.96,36.92,0
0,0.05,105,11,96,90.9,37.01,1
1,0.18,91,12,98,96.55,37.15,0
1,0.31,106,20,69,94.4,37.39,0
0,0.35,69,25,65,91.12,36.08,0
1,0.02,64,10,88,94.71,36.5,0
0,0.28,83,18,90,96.23,37.49,0
1,0.3,117,2,76,91.7,36.43,1
0,0.24,51,3,84,96.6,36.99,1
0,0.02,99,8,84,95.09,37.06,1
1,0.43,118,3,71,91.99,37.45,0
0,0.13,117,10,81,94.9,37.12,0
1,0.35,95,21,79,92.36,37.47,1
0,0.32,99,29,61,99.44,37.42,0
0,0.18,100,22,68,90.88,36.57,0
1,0.13,69,14,79,99.1,36.49,0
0,0.33,119,22,72,98.63,36.46,0
1,0.5,68,21,96,99.17,36.48,0
0,0.17,68,24,61,97.65,37.32,1
1,0.16,85,5,72,91.07,36.28,1
0,0.3,79,22,61,93.59,37.03,1
0,0.26,110,23,83,91.84,36.58,1
0,0.09,78,2,86,97.65,36.02,1
1,0.12,75,25,73,90.66,37.39,1
1,0.35,108,29,75,94.28,37.16,1
1,0.2,118,17,62,95.21,36.68,0
0,0.26,100,24,62,95.58,36.77,0
0,0.15,100,29,79,97.74,36.43,0
1,0.15,56,23,93,99.04,36.7,1
0,0.36,64,6,97,99.38,37.04,0
1,0.21,107,1,71,94.54,37.34,0
1,0.05,91,23,70,97.18,36.19,0
1,0.32,60,17,84,97.27,37.46,0
1,0.28,55,25,70,99.12,36.85,0
0,0.44,72,25,63,94.2,36.46,1
1,0.32,65,29,68,99.6,36.01,1
0,0.23,113,18,60,96.08,36.74,0
1,0.23,106,3,98,96,36.37,1
0,0.03,68,2,82,90.37,37.28,1
1,0.46,56,4,86,99.94,36.24,1
0,0.48,96,30,62,90.93,36.45,1
1,0.41,104,27,95,90.65,36.71,0
1,0.17,102,17,73,96.96,36.92,0
0,0.25,86,14,98,98.48,36.39,1
0,0.31,113,17,100,94.98,37.21,0
1,0.49,50,4,61,94.65,37.2,0
1,0.21,92,12,95,98.06,36.32,0
1,0.13,58,10,79,95.07,36.49,0
0,0.35,93,13,96,96.16,36.04,0
0,0.17,93,30,90,99.16,37.2,0
1,0.09,108,29,94,98.96,36.69,1
0,0.42,88,19,80,95.55,36.03,1
1,0.04,69,9,61,93.39,36.56,0
1,0.1,64,28,79,97.05,36.47,0
1,0.21,113,29,75,93.72,37.24,1
0,0.27,72,4,83,97.85,37.17,0
1,0.26,111,29,92,91.54,36.51,1
1,0.39,68,25,66,98.22,37.41,0
0,0.37,108,13,93,91.16,36.47,0
0,0.17,55,4,93,97.66,37.12,0
1,0.32,76,11,72,91.93,36.41,1
1,0.34,84,5,70,92.74,36.02,0
0,0.28,120,11,77,91.42,37.06,1
0,0.09,89,20,81,95.41,36.08,0
1,0.45,56,4,84,90.54,36.64,0
1,0.31,89,11,72,97.13,37.01,0
1,0.29,61,27,89,90.97,36.47,1
1,0.12,78,5,99,92.58,36.55,0
1,0.4,91,15,91,90.3,36.71,1
1,0.24,71,10,82,96.04,36.19,0
1,0.41,63,11,95,96.49,37.19,1
1,0.3,80,20,75,95.48,37.46,1
0,0.18,105,26,87,95.67,36.51,0
0,0.33,59,24,96,98.37,36.17,1
1,0.28,106,6,79,99.56,36.1,0
1,0.17,57,3,73,98.17,37.33,0
0,0.33,107,18,78,93.9,36.87,0
0,0.34,90,10,96,97.94,37.02,1
1,0.5,51,20,92,94.04,36.19,1
0,0.19,120,2,60,97.03,37.23,1
0,0.43,53,8,87,97.02,36.59,1
1,0.21,105,18,73,96.62,36.71,0
1,0.42,96,27,86,91.54,37.5,0
0,0.02,52,5,91,96.58,37.46,0
0,0.08,103,28,89,98.94,37.04,1
0,0.23,104,18,88,93.85,36.34,1
0,0.29,80,23,92,92.69,37.39,1
0,0.49,111,23,83,91.13,36.72,0
0,0.37,117,28,77,94.65,36.12,0
0,0.24,59,22,100,95.39,36.87,0
1,0.27,51,16,89,95.13,36.7,1
1,0.18,87,10,70,90.35,37.38,1
1,0.04,110,19,70,95.73,36.98,1
0,0.15,60,5,92,90.77,37.18,1
0,0.31,85,28,76,90.14,36.17,0
0,0.33,97,26,71,92.61,37.05,1
0,0.4,54,11,65,99.67,36.89,0
1,0.38,102,25,84,92.38,36.66,0
0,0.29,94,2,76,97.55,36.17,0
1,0.21,88,16,94,92.34,37.03,1
1,0.14,117,28,87,90.12,37.39,1
1,0.34,117,22,62,90.97,36.8,1
1,0.31,84,11,77,92.67,36.15,1
1,0.39,80,24,97,97.7,36.78,0
1,0.28,51,27,64,90.12,36.15,0
1,0.18,86,9,72,90.34,36.93,0
0,0.48,65,23,67,90.86,36.91,1
0,0.45,73,9,78,94.67,37.4,1
1,0.39,91,9,70,97.81,36.42,0
1,0.2,57,9,76,91.78,36.1,0
1,0.1,112,4,69,95.41,36.65,0
1,0.36,63,2,64,90.7,37.09,1
0,0.45,69,21,100,90.01,36.06,1
1,0.08,92,29,85,95.75,36.77,1
1,0.22,58,18,74,90.03,37.43,1
0,0.29,95,11,79,94.01,36.95,0
1,0.27,93,3,89,97.6,36.43,0
0,0.28,99,22,72,92.99,36.59,0
1,0.25,106,24,72,91.4,36.29,0
1,0.2,119,21,79,95,37.45,1
0,0.03,57,11,62,94.06,36.32,1
0,0.37,79,30,64,90.37,36.21,0
1,0.45,55,8,68,90.14,36.95,1
0,0.23,71,27,97,90.64,37.23,0
1,0.3,78,3,72,94.26,37.22,1
1,0.07,119,5,80,98.36,37.19,0
0,0.17,65,9,69,97.58,36.25,1
0,0.22,55,5,66,97.91,36.95,1
0,0.02,112,3,60,90.07,37.39,1
1,0.35,110,23,68,92.06,36.96,1
1,0.13,72,20,62,95.96,37.08,0
1,0.18,50,18,75,91.92,37.48,0
1,0.43,119,17,74,94.64,36.94,0
1,0.04,64,26,69,96.85,37.45,1
1,0.1,55,2,83,92.85,36.65,1
1,0.03,56,30,94,91.76,37.18,1
0,0.04,80,24,88,95.93,36.49,0
1,0.12,64,11,74,90.98,37.11,0
1,0.45,59,16,97,94.84,37.34,0
0,0.46,108,6,84,93.73,36.69,0
1,0.49,75,11,68,90.32,36.85,1
0,0.06,109,15,86,91.71,36.52,1
0,0.4,71,19,95,98.55,36.13,1
0,0.3,109,9,60,97.3,37.1,0
0,0.17,78,29,97,99.46,37.37,0
1,0.49,55,16,92,90.34,36.8,1
0,0.23,80,3,95,97.53,37.04,1
0,0.08,87,8,65,90.16,37,0
1,0.43,53,15,89,97.72,37.31,1
0,0.4,97,21,89,97.04,36,0
1,0.45,92,17,62,92.97,37.13,0
0,0.31,92,24,63,95.15,37.37,1
0,0.06,96,15,99,90.41,36.55,0
0,0.08,92,8,94,91.14,36.72,0
0,0.17,84,17,87,92.77,36.1,1
1,0.25,117,27,67,94.7,36.8,1
1,0.31,58,7,89,90.87,36.59,0
1,0.48,59,4,70,92.76,37.05,1
0,0.44,116,21,61,92.93,37.45,0
1,0.18,106,24,61,92.92,36.09,0
1,0.21,93,21,80,94.86,37,1
1,0.16,66,29,79,91.72,36.39,1
1,0.49,56,5,82,92.84,37.43,0
1,0.1,72,27,69,91.61,36.18,1
0,0.23,97,6,73,95.62,36.05,1
1,0.08,107,18,70,95.34,36.18,0
1,0.47,68,15,80,91.56,37.46,1
1,0.24,87,25,96,96.67,37.2,1
1,0.35,111,29,62,91.39,36.83,1
0,0.21,78,15,82,90.92,36.08,0
0,0.39,85,7,61,90.84,37.27,0
1,0.11,90,20,98,95.12,36.08,1
1,0.08,104,12,84,93.73,36.43,1
1,0.49,61,7,88,97.42,36.62,1
1,0.09,104,24,86,91.4,36.88,0
0,0.11,110,28,93,99.87,36.1,1
0,0.01,84,14,71,95.56,37.07,0
0,0.1,98,10,95,94.91,37.23,1
1,0.25,109,8,61,97.91,36.23,1
1,0.07,86,14,71,94.92,37.03,0
0,0.07,85,16,64,95.99,36.54,1
1,0.44,110,23,67,93.73,37.1,0
1,0.09,57,5,80,94.61,37.04,1
0,0.04,96,14,100,99.12,36.53,1
1,0.27,59,17,72,97.66,36.27,0
0,0.28,90,27,79,92.71,37.05,1
0,0.27,95,27,69,90.13,36.78,1
1,0.21,70,4,73,91.55,36.33,0
0,0.21,59,4,68,99.23,36.72,1
1,0.08,106,29,98,95.23,37.46,0
1,0.02,65,8,68,98.57,36.21,0
1,0.07,66,3,87,96.91,37.18,0
0,0.39,105,2,72,91.08,37.19,0
1,0.07,82,2,64,93.02,36.02,0
0,0.46,76,19,72,91.85,36.53,0
0,0.42,85,19,82,93.52,37.28,0
0,0.06,51,17,73,97.16,37.45,0
0,0.49,62,30,73,99.2,37.28,1
1,0.35,73,15,66,91.81,36.53,1
1,0.11,79,14,67,97.61,36.47,1
0,0.26,113,25,83,97.05,36.84,0
0,0.17,64,13,78,94.57,37.1,1
0,0.28,87,28,87,91.89,36.1,1
1,0.1,112,22,66,93.96,36.78,0
0,0.08,101,23,97,99.78,37.11,0
0,0.19,75,11,72,95.95,37.49,0
0,0.42,113,9,97,95.94,37.13,1
1,0.24,101,16,92,92.79,37.15,0
0,0.13,113,8,100,99.42,36.04,0
0,0.25,53,6,84,96.05,36.49,1
0,0.38,116,25,91,97.93,36.3,1
1,0.26,119,11,94,95.47,37.43,0
1,0.44,65,13,88,93.15,36.56,1
0,0.03,88,29,70,94.91,36.2,1
1,0.38,112,22,95,96.85,36.86,1
0,0.26,100,9,91,95.91,36.57,1
1,0.17,53,19,62,91.28,36.55,0
1,0.2,104,12,82,94.12,36.08,0
0,0.12,89,19,65,99.1,36.1,1
0,0.18,52,18,80,90.37,36.99,1
1,0.14,110,19,61,99.86,36.57,1
1,0.29,112,4,73,93.36,36.75,1
0,0.31,96,14,72,94.97,37.27,0
0,0.15,56,10,96,94.02,36.34,0
0,0.3,84,3,96,98.01,36.71,0
1,0.4,88,17,79,94.33,36.81,0
1,0.21,115,15,95,91.81,36.03,0
1,0.11,109,9,100,95.33,36.92,1
0,0.27,96,15,69,92.4,37.12,1
1,0.21,58,21,73,98.46,36.4,1
0,0.14,80,13,75,91.14,36.29,0
1,0.24,105,14,62,92.02,36.41,0
1,0.4,85,22,95,91.76,37.28,1
0,0.04,60,11,98,92.98,36.1,1
1,0.34,61,13,68,92.36,36.86,0
1,0.25,61,8,98,91.22,37.21,1
1,0.4,80,30,87,92.18,36.16,0
1,0.23,82,28,97,90.56,36.8,0
1,0.28,110,22,75,99.63,37.32,0
1,0.24,97,27,79,90.21,37.45,0
0,0.35,80,9,95,93.85,36.96,1
0,0.27,80,28,88,93.88,37.36,1
1,0.16,80,10,73,98.59,36.24,1
1,0.44,102,26,62,92.74,36.12,1
1,0.37,92,23,87,98.77,37.23,0
1,0.26,95,14,98,97.29,36.82,1
1,0.35,56,21,71,96.3,37.19,0
0,0.21,89,11,96,90.82,36.24,0
1,0.4,90,15,90,98.74,36.2,0
1,0.4,75,3,86,93.68,36.59,1
0,0.02,52,30,95,96.47,36.94,0
1,0.11,71,2,85,96.18,36.9,0
0,0.48,71,19,67,90.14,36.79,1
1,0.07,76,7,77,92.88,36.74,0
1,0.43,77,27,78,97.27,36.28,0
1,0.4,53,10,76,92.35,36.68,0
1,0.3,108,3,60,94.69,37.31,1
0,0.36,104,24,98,92.56,36.14,0
0,0.17,80,16,82,99.97,37.41,0
0,0.13,98,10,85,96.71,36.2,0
0,0.14,114,16,81,98.78,36.2,1
1,0.08,64,11,62,99.79,36.75,1
1,0.46,86,29,76,96.13,37.14,1
1,0.22,71,11,91,97.64,36.23,1
0,0.1,56,8,71,90.36,36.39,1
1,0.07,113,2,88,93.57,37.06,1
1,0.25,68,4,82,90.94,37.3,0
0,0.38,84,19,97,92.12,37.5,0
0,0.21,59,8,91,96.77,37.33,0
1,0.34,65,13,83,95.9,37.43,1
0,0.02,108,27,90,94.54,37.43,0
1,0.49,107,11,96,91.29,37.29,1
1,0.4,59,18,98,93.81,36.6,0
0,0.48,101,3,61,98.52,36.24,1
1,0.33,69,4,79,94.91,36.65,1
0,0.19,62,27,83,95.13,36.73,1
1,0.14,104,3,87,98.11,36.92,1
1,0.06,115,11,89,96.76,36.97,0
1,0.27,117,3,78,94.68,36.12,1
1,0.08,66,22,79,98.42,36.78,1
0,0.28,55,17,66,95.11,36.62,1
1,0.18,60,25,92,90.16,37.11,1
0,0.4,100,2,65,94.16,37.06,1
1,0.38,107,20,76,93.41,37.38,0
0,0.1,83,28,66,94.34,36.03,1
0,0.02,111,15,85,98.69,37.45,1
1,0.31,96,23,85,98.05,36.13,0
0,0.1,52,23,72,98.59,36.31,0
0,0.22,118,7,65,93.01,36.7,1
1,0.02,71,29,69,97.39,36.67,1
1,0.02,107,19,75,92.01,36.85,1
0,0.17,63,21,87,99.79,37.27,1
0,0.25,112,17,97,97.25,37.4,1
0,0.36,117,1,87,95.76,36.83,1
1,0.45,64,16,99,99.39,36.52,1
0,0.09,74,16,82,94.38,36.76,1
1,0.07,87,24,84,99.6,37.25,1
1,0.4,70,20,73,92.82,37.12,1
0,0.09,70,20,91,91.01,36.62,1
1,0.13,56,1,82,98.81,36.54,0
0,0.42,114,2,64,93.38,36.17,0
0,0.29,112,9,81,97.85,37.15,1
0,0.43,115,20,66,97.06,37.39,1
1,0.48,64,4,99,96.1,37.29,0
0,0.26,71,21,67,98.71,37.37,0
1,0.36,114,16,66,91.54,36.55,0
0,0.43,106,14,60,92.45,37.21,1
1,0.26,60,9,83,97.15,36.62,0
0,0.38,117,14,74,91.38,36.64,1
1,0.48,116,26,83,99.44,36.66,0
0,0.05,90,13,70,94.34,36.59,0
0,0.45,57,21,93,99.73,36.63,1
1,0.46,51,27,77,99,36.92,0
1,0.23,76,29,94,96.24,36.93,1
1,0.44,101,25,72,98.81,36.13,1
1,0.37,66,17,94,92.84,36.14,1
1,0.38,70,1,61,98.9,36.81,1
0,0.42,88,24,87,99.87,36.17,0
1,0.14,114,12,67,90.48,36.98,0
1,0.16,50,15,81,99.83,37.21,0
1,0.16,67,23,84,95.2,36.37,1
0,0.41,96,15,66,91.47,36.64,1
0,0.06,104,29,68,94.76,36.67,1
1,0.3,116,25,85,98.72,36.88,1
1,0.35,112,24,86,98.24,36.22,0
1,0.36,66,23,92,98.63,36.18,0
1,0.24,70,18,83,99.22,36.18,1
0,0.07,87,2,93,91.53,36.56,1
1,0.15,53,26,69,91.42,36.88,0
1,0.45,77,6,91,90.02,36.82,0
0,0.21,89,19,88,99,37.17,1
0,0.38,114,21,89,97.62,37,0
1,0.05,102,13,74,99,36.51,0
1,0.37,61,28,70,97.07,36.86,1
0,0.33,60,7,99,95.42,37.14,0
1,0.26,52,4,94,91.8,36.03,0
0,0.42,106,3,94,96.07,36.6,0
1,0.43,52,11,87,91.81,36.04,1
1,0.14,64,4,94,91.68,36.22,1
0,0.09,102,22,70,90.59,37.44,0
0,0.36,88,13,66,93.2,36.62,1
1,0.19,65,2,72,92.4,36.9,0
1,0.26,114,13,67,92.69,36.48,1
0,0.25,102,21,74,99.14,36.03,0
0,0.38,66,10,96,94.07,36.13,0
0,0.19,71,26,75,95.38,36.64,1
0,0.01,109,27,99,92.89,37.46,0
0,0.47,111,9,98,92.51,37.02,1
0,0.3,115,10,62,91.61,36.8,0
1,0.05,65,27,68,97.25,37.5,1
0,0.31,90,29,81,96.35,37.47,1
1,0.13,91,11,73,94.6,36.9,0
0,0.33,50,20,90,90.04,36.01,0
1,0.28,112,25,85,95.38,37.18,0
0,0.45,106,22,67,93.53,37.22,1
1,0.1,51,4,89,93.7,36.29,0
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
import numpy as np
import pickle
import tensorflow as tf
import pandas as pd
import pymongo
from bson import ObjectId
# Load the trained model and scaler
model = tf.keras.models.load_model('weights/health_data_dementia.h5')
with open('weights/scalar_health_data.pkl', 'rb') as f:
scalar = pickle.load(f)
# Function to process new data and make predictions
def predict_dementia(new_data):
# Preprocess the new data
new_data = scalar.transform(new_data.reshape(1, -1))
# Reshape the data to match the model's input shape
n_steps, n_features = model.input_shape[1:]
X = np.zeros((1, n_steps, n_features))
X[0] = new_data
# Make predictions
predictions = model.predict(X)
# Check the prediction
if predictions[0][0] >= 0.5:
result = "Patient has dementia"
else:
result = "Patient doesn't have dementia"
return result
# Set up MongoDB connection
try:
client = pymongo.MongoClient("mongodb+srv://ITP:89DbKo5LYRogaw96@cluster0.3agof.mongodb.net/?retryWrites=true&w=majority")
db = client["Heal"]
print("DB accessed!")
except Exception as e:
print("Error while connecting to MongoDB:", e)
exit() # Exit the script if there's a connection error
# Create a collection for user data
user_data_collection = db["health"]
# Function to retrieve user data from MongoDB
def get_latest_user_data():
try:
# Sort the documents in descending order by _id (assuming _id is a timestamp)
latest_user_data = user_data_collection.find().sort([("_id", pymongo.DESCENDING)]).limit(1)
if latest_user_data:
return latest_user_data[0]
else:
return None
except Exception as e:
print("Error while retrieving user data:", e)
return None
latest_user_data = get_latest_user_data()
if latest_user_data:
for key, value in latest_user_data.items():
print(f"{key}: {value}")
else:
print("User data not found.")
# Function to create a new array
def get_Android_data(api_data):
if latest_user_data is not None and api_data is not None:
# Create an array with the required features
new_data = np.array([api_data["Diabetic"], api_data["Alcohol_Level"], api_data["Weight"], api_data["MRI_Delay"],
latest_user_data["HeartRate"], latest_user_data["BloodOxygenLevel"], latest_user_data["BodyTemperature"]])
result = predict_dementia(new_data)
return result
else:
print("User data not found or API data is missing.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment