MCPcopy Index your code
hub / github.com/Okes2024/Machine-Learning-to-Predict-Suicide-Risk

github.com/Okes2024/Machine-Learning-to-Predict-Suicide-Risk @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1 symbols 11 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Machine-Learning-to-Predict-Suicide-Risk

This project demonstrates how machine learning models can be applied to predict suicide risk using synthetic demographic, psychological, and behavioral data. It uses Logistic Regression and Random Forest, evaluates model performance, and visualizes results with confusion matrices and feature importance charts.

⚠️ Disclaimer: This project uses synthetic data and is for educational purposes only. It is not intended for clinical use or real-world medical decision-making.

📂 Project Structure

suicide_risk_data.xlsx → Synthetic dataset (>300 points).

suicide_risk_prediction.py → Python script for training, evaluation, and visualization.

README.md → Documentation.

⚙️ Features

Synthetic dataset with features:

Age

Gender (encoded)

Sleep hours

Stress level

Depression score

Anxiety score

Social support level

Substance use frequency

Target variable: Suicide Risk (0 = Low, 1 = High)

Machine learning models:

Logistic Regression

Random Forest

Evaluation metrics: Accuracy, Precision, Recall, F1-score

Visualizations:

Confusion Matrix

Feature Importance

🚀 How to Run

Clone or download this repository.

Install dependencies:

pip install numpy pandas matplotlib scikit-learn seaborn openpyxl

Place suicide_risk_data.xlsx in the same folder as suicide_risk_prediction.py.

Run the script:

python suicide_risk_prediction.py

📊 Dataset

The dataset (suicide_risk_data.xlsx) is synthetic and includes:

Demographics (Age, Gender)

Lifestyle (Sleep, Substance use)

Psychological factors (Stress, Depression, Anxiety, Social support)

Target: Suicide Risk (0 or 1)

📈 Example Outputs

Classification Report with Accuracy, Precision, Recall, and F1-score.

Confusion Matrix Heatmap.

Feature Importance Ranking (Random Forest).

🔮 Future Improvements

Use real-world mental health survey datasets (e.g., WHO, CDC, or Kaggle).

Implement deep learning models for improved predictions.

Explore explainable AI (XAI) methods to interpret model predictions.

Authur Name: Okes Imoni Github: https://github.com/Okes2024

Core symbols most depended-on inside this repo

evaluate_model
called by 2
suicide_risk_prediction.py

Shape

Function 1

Languages

Python100%

Modules by API surface

suicide_risk_prediction.py1 symbols

For agents

$ claude mcp add Machine-Learning-to-Predict-Suicide-Risk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact