Health Monitoring ML Model – Download and Use in Your Project – CSE x Typhon

2

Want to learn Machine Learning? Download these models, test them on your own data, and create your own project.

Nowadays, everyone is conscious about their health. Smartwatches, fitness bands, and health apps track things like our heart rate, steps, and sleep.

But can this data tell us whether we’re at risk? Yes! Machine learning makes it possible. In this article, we bring you an ML model that

  • Health Predict according to Age, Heart Rate, Steps, Sleep
  • Use Random Forest Algorithm
  • Download and Use in Your Project

What the model does?

Input Output
Age Healthy
Heart Rate (BPM) Moderate Risk
Steps per Day High Risk
Sleep Hours

How it works?

We’ve trained a Random Forest Classifier. It takes 4 inputs and produces one of 3 output categories.

AgeHeart RateStepsSleepLabel
2575100007.5Healthy
5010020004.5High Risk
358570006.0Moderate Risk

Code – which creates the model

# train_model.py
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
import joblib

# Dataset
data = {
    'Age': [25, 45, 35, 28, 50, 32, 22, 48, 38, 55],
    'HeartRate': [75, 95, 85, 70, 100, 82, 68, 98, 88, 102],
    'Steps': [10000, 3000, 7000, 12000, 2000, 8000, 11000, 3500, 6500, 1800],
    'Sleep': [7.5, 5.0, 6.0, 8.0, 4.5, 6.5, 7.8, 5.2, 6.2, 4.0],
    'Label': ['Healthy', 'High Risk', 'Moderate Risk', 'Healthy', 'High Risk', 
              'Moderate Risk', 'Healthy', 'High Risk', 'Moderate Risk', 'High Risk']
}

df = pd.DataFrame(data)
label_map = {'Healthy': 0, 'Moderate Risk': 1, 'High Risk': 2}
df['Label_Num'] = df['Label'].map(label_map)

X = df[['Age', 'HeartRate', 'Steps', 'Sleep']]
y = df['Label_Num']

model = RandomForestClassifier()
model.fit(X, y)

joblib.dump(model, 'health_model.pkl')
print("✅ Model Saved as health_model.pkl")

Health Monitoring ML Model
Health Monitoring ML Model

How to use the model in your project?

Step 1: Load the model
import joblib
import numpy as np

model = joblib.load('health_model.pkl')
Step 2: Make a prediction
# अपनी values यहाँ दो
user_data = np.array([[30, 80, 9000, 7.0]])  # Age, HR, Steps, Sleep

result = model.predict(user_data)
print(result)  # Output: 0 = Healthy, 1 = Moderate, 2 = High Risk
Step 3: Understand the result
status = {0: '✅ Healthy', 1: '⚠️ Moderate Risk', 2: '❌ High Risk'}
print(status[result[0]])

How to install it on your website? (Flask Example)

from flask import Flask, request, jsonify
import joblib
import numpy as np

app = Flask(__name__)
model = joblib.load('health_model.pkl')

@app.route('/predict', methods=['POST'])
def predict():
    data = request.get_json()
    input_data = np.array([[data['age'], data['heartRate'], data['steps'], data['sleep']]])
    pred = model.predict(input_data)[0]
    return jsonify({'status': ['Healthy', 'Moderate Risk', 'High Risk'][pred]})

if __name__ == '__main__':
    app.run(debug=True)

Model Accuracy and Improvement Tips

ProblemSolution
Less Data download large dataset from Kaggle
Less Features also add BP, Calories, Oxygen Level
Less Accuracy XGBoost and Neural Network also try

what will you learn?

By downloading and using this model you

  • understand real-life application of ML Model
  • practically use of Random Forest algorithm
  • you can make your own health monitoring app
  • use in College project

Message from CSE x Typhon

This model is completely free. Download it, add it to your projects, and share it with friends.

Credits: CSE x Typhon Team License: MIT – anyone can use it anywhere

Links and Resources

  • Model Download: health_model.pkl
  • Complete Code: GitHub Repo
  • Dataset Source: Kaggle – Heart Health Dataset

Questions?

If you have any doubts, leave a comment or ask on CSE x Typhon’s social media. We’ll answer.

Happy Coding!
CSE x Typhon – Learn, Build, Share.

Frequently Asked Questions (FAQs)

1. What does this ML model do?

This model predicts a person’s health status based on four inputs:
Age
Heart Rate (BPM)
Steps per day
Sleep hours (per night)
It returns one of three outputs:
Healthy
Moderate Risk
 High Risk

2. Is this model free to download?

Yes, 100% free.
You can download, use, modify, and even share it with your friends. No charges, no hidden fees.

3. What algorithm is used in this model?

We used Random Forest Classifier – a popular machine learning algorithm that works well for classification problems like health prediction.

4. Can I use this model for my college project?

Absolutely!
This model is perfect for:
College assignments
Mini projects
Final year projects
Research experiments
Just give credit to CSE x Typhon.

5. How do I load the model in Python?

import joblib
model = joblib.load(‘health_model.pkl’)
print(“✅ Model loaded successfully!”)

6. How do I make a prediction?

import numpy as np
Input order: [Age, HeartRate, Steps, Sleep]
user_data = np.array([[25, 75, 10000, 7.5]])
prediction = model.predict(user_data)
print(prediction) # Output: 0, 1, or 2
Output meaning:
0 = Healthy
1 = Moderate Risk
2 = High Risk

2 Comments
  1. Satyendra
    Satyendra says

    Very useful..

    1. v yadav
      v yadav says

      Thanks

Leave A Reply

Your email address will not be published.