Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jonatan-leal/ia-proyecto-sustituto/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The diabetes prediction model analyzes 8 patient characteristics to assess diabetes risk. This page provides detailed medical context for each feature, helping healthcare professionals understand what the model considers when making predictions.
Total Features: 8 (2 categorical, 6 numeric)Clinical Basis: All features are established diabetes risk factors in medical literature

Feature Summary Table

FeatureTypeClinical SignificanceNormal RangeHigh Risk
GenderCategoricalMetabolic differencesN/AMale (slightly)
AgeNumericRisk increases with ageN/A>45 years
HypertensionBinaryInsulin resistance marker0 (no)1 (yes)
Heart DiseaseBinaryMetabolic syndrome indicator0 (no)1 (yes)
Smoking HistoryCategoricalInflammatory effectsnevercurrent
BMINumericObesity indicator18.5-24.9≥30
HbA1c LevelNumericLong-term glucose control<5.7%≥6.5%
Blood GlucoseNumericCurrent glucose level<100 mg/dL≥126 mg/dL

1. Gender

Description

Biological sex of the patient.
Why Gender Matters for Diabetes:
  • Hormonal Differences: Estrogen and testosterone affect insulin sensitivity
  • Body Composition: Men tend to accumulate visceral fat (higher diabetes risk)
  • Prevalence: Slightly higher diabetes rates in men in some populations
  • Complications: Women with diabetes have higher cardiovascular mortality
Research Notes:
  • Type 2 diabetes is ~1.5x more common in men
  • Women with PCOS (polycystic ovary syndrome) have elevated risk
  • Gestational diabetes increases future type 2 risk in women

2. Age

Description

Patient’s age in years.

Clinical Significance

Risk Progression

Diabetes risk increases dramatically after age 45, with peak incidence in 65-79 age group

Physiological Changes

Aging causes decreased insulin secretion, increased insulin resistance, and reduced beta-cell function
Age Range    | Diabetes Risk | Contributing Factors
-------------|---------------|---------------------
< 30 years   | Low           | Peak metabolic function
30-44 years  | Moderate      | Lifestyle factors emerge
45-64 years  | High          | Insulin resistance increases
65+ years    | Very High     | Multiple comorbidities

Medical Context

  1. Beta-Cell Decline: Pancreatic beta cells produce less insulin with age
  2. Increased Visceral Fat: Abdominal fat accumulation worsens with age
  3. Mitochondrial Dysfunction: Cellular energy metabolism becomes less efficient
  4. Chronic Inflammation: Age-related inflammation affects insulin signaling
  5. Sarcopenia: Muscle loss reduces glucose disposal capacity

Data Format

{
  "age": 36,
  // Integer, typically 0-120
}

Example Risk Profiles

{
  "age": 28,
  "bmi": 22.0,
  "HbA1c_level": 4.9
}
Assessment: Young age is protective even with other risk factors present

3. Hypertension

Description

Indicates whether the patient has been diagnosed with high blood pressure.

Clinical Significance

Hypertension and diabetes frequently co-occur in metabolic syndrome:
1

Shared Pathophysiology

Both conditions involve:
  • Insulin resistance
  • Endothelial dysfunction
  • Chronic inflammation
  • Sympathetic nervous system overactivity
2

Bidirectional Risk

  • Hypertension increases diabetes risk by 2-3x
  • Diabetes increases hypertension risk
  • Together, they amplify cardiovascular complications
3

Clinical Impact

Patients with both conditions face:
  • 3-4x higher stroke risk
  • 2-3x higher heart attack risk
  • Accelerated kidney damage
  • Increased retinopathy (eye damage)

Medical Definition

Hypertension Diagnosis:
  • Systolic BP ≥ 140 mmHg, OR
  • Diastolic BP ≥ 90 mmHg
  • Measured on multiple occasions

Data Format

{
  "hypertension": 0  // 0 = No, 1 = Yes
}
Binary Values:
  • 0: No hypertension diagnosis
  • 1: Has hypertension

Prevalence

Co-occurrence: ~75% of people with diabetes also have hypertensionIn Dataset: Approximately 7-10% of patients have hypertension=1

4. Heart Disease

Description

Indicates whether the patient has been diagnosed with cardiovascular disease.

Clinical Significance

Heart disease and diabetes share common risk factors and mechanisms:

Atherosclerosis

Both conditions accelerate plaque buildup in arteries through oxidative stress and inflammation

Metabolic Syndrome

Heart disease, diabetes, hypertension, and obesity cluster together in metabolic syndrome

Relationship with Diabetes

  1. Shared Etiology: Both stem from insulin resistance and metabolic dysfunction
  2. Inflammatory State: Cardiovascular inflammation impairs insulin signaling
  3. Endothelial Dysfunction: Damaged blood vessel lining affects glucose metabolism
  4. Medication Effects: Some cardiac medications (beta-blockers, thiazides) can worsen glucose control

Data Format

{
  "heart_disease": 0  // 0 = No, 1 = Yes
}
Binary Values:
  • 0: No heart disease diagnosis
  • 1: Has heart disease (CAD, MI, CHF, etc.)

Clinical Implications

High-Risk Combination: Patients with both diabetes and heart disease require aggressive management:
  • Tight blood sugar control (HbA1c < 7%)
  • Blood pressure < 130/80 mmHg
  • LDL cholesterol < 70 mg/dL
  • Antiplatelet therapy
  • ACE inhibitors or ARBs

5. Smoking History

Description

Patient’s smoking status and history.

Clinical Significance

Smoking affects diabetes risk through multiple mechanisms:
1

Insulin Resistance

Nicotine and other toxins impair insulin signaling, increasing blood glucose
2

Inflammation

Smoking triggers chronic systemic inflammation, a key driver of metabolic disease
3

Abdominal Fat

Smokers tend to accumulate visceral fat, the most metabolically harmful type
4

Beta-Cell Toxicity

Smoking may directly damage insulin-producing pancreatic cells

Categories

Code: 0Meaning: Smoking history not available or not documentedClinical Handling: Assume unknown risk; request information if possible

Data Format

{
  "smoking_history": "current"
  // Options: "No Info", "current", "ever", "former", "never", "not current"
}

Risk Quantification

Relative Diabetes Risk by Smoking Status:
Smoking Status    | Relative Risk | Compared to Never Smokers
------------------|---------------|---------------------------
Never             | 1.0x          | Baseline
Former (quit >10y)| 1.1x          | Nearly baseline
Former (quit <10y)| 1.2x          | Slightly elevated
Current (light)   | 1.3x          | Moderate increase
Current (heavy)   | 1.5x          | Significant increase

6. BMI (Body Mass Index)

Description

A measure of body fat based on height and weight: BMI = weight (kg) / height² (m²)

Clinical Significance

Most Important Modifiable Risk Factor: Obesity is the single strongest predictor of type 2 diabetes, with BMI ≥30 increasing risk by 7-10x.

BMI Categories

BMI RangeCategoryDiabetes Risk
< 18.5UnderweightLow
18.5 - 24.9Normal WeightBaseline (1x)
25.0 - 29.9Overweight2-3x
30.0 - 34.9Obese (Class I)5-7x
35.0 - 39.9Obese (Class II)7-10x
≥ 40.0Obese (Class III)10-12x

Data Format

{
  "bmi": 32.27
  // Float, typical range 10-95
}
Example Calculations:
# BMI = weight (kg) / height² (m²)

# Example 1: Normal weight
weight = 70  # kg
height = 1.75  # meters
bmi = 70 / (1.75 ** 2) = 22.86
# Classification: Normal

# Example 2: Obese
weight = 95  # kg
height = 1.70  # meters
bmi = 95 / (1.70 ** 2) = 32.87
# Classification: Obese Class I

Example Profiles

{
  "bmi": 22.5,
  "age": 30,
  "HbA1c_level": 5.0
}
// Prediction: Likely no diabetes

7. HbA1c Level (Hemoglobin A1c)

Description

Average blood glucose level over the past 2-3 months, expressed as a percentage.

Clinical Significance

Gold Standard: HbA1c is the primary diagnostic test for diabetes and the best indicator of long-term glucose control.

How HbA1c Works

Glycation Process:
  1. Glucose in blood binds to hemoglobin in red blood cells
  2. Higher blood glucose → more glucose-hemoglobin binding (glycation)
  3. Red blood cells live ~120 days, so HbA1c reflects 2-3 month average
  4. Measured as percentage of hemoglobin that’s glycated
Advantages:
  • Not affected by recent meals (fasting not required)
  • Stable day-to-day
  • Reflects long-term control
  • Strong predictor of complications

Diagnostic Thresholds

HbA1c LevelCategoryInterpretation
< 5.7%NormalHealthy glucose metabolism
5.7% - 6.4%PrediabetesImpaired glucose tolerance; reversible
≥ 6.5%DiabetesDiagnostic for diabetes (if confirmed)
≥ 8.0%Poorly ControlledUrgent intervention needed
≥ 9.0%Very Poor ControlHigh complication risk

Data Format

{
  "HbA1c_level": 6.2
  // Float, typically 3.5-15.0
  // Expressed as percentage
}

Conversion to Average Glucose

Estimated Average Glucose (eAG):
eAG (mg/dL) = 28.7 × HbA1c - 46.7

Examples:
HbA1c 5.0% → eAG = 97 mg/dL (normal)
HbA1c 6.0% → eAG = 126 mg/dL (prediabetic)
HbA1c 7.0% → eAG = 154 mg/dL (diabetic)
HbA1c 8.0% → eAG = 183 mg/dL (poorly controlled)

Example Risk Profiles

{
  "HbA1c_level": 5.0,
  "blood_glucose_level": 95
}
// Assessment: Healthy glucose metabolism
Critical Note: HbA1c ≥ 6.5% is diagnostic for diabetes when confirmed with repeat testing. Patients with values in this range should be immediately flagged for clinical evaluation.

8. Blood Glucose Level

Description

Current blood glucose (sugar) concentration, measured in mg/dL (milligrams per deciliter).

Clinical Significance

Snapshot Measurement

Unlike HbA1c (2-3 month average), blood glucose shows current glucose level at time of measurement

State-Dependent

Interpretation depends on when measured: fasting, post-meal, random, etc.

Diagnostic Thresholds

Measured after 8+ hours without food:
Glucose LevelCategoryInterpretation
< 100 mg/dLNormalHealthy glucose regulation
100-125 mg/dLPrediabetesImpaired fasting glucose
≥ 126 mg/dLDiabetesDiagnostic if confirmed
Dataset Context: The dataset doesn’t specify fasting status, so interpretation requires caution.

Data Format

{
  "blood_glucose_level": 220
  // Integer, typically 60-400 mg/dL
}

Clinical Ranges

Glucose Range     | Clinical Meaning           | Action
------------------|----------------------------|------------------
< 70 mg/dL        | Hypoglycemia               | Immediate treatment
70-99 mg/dL       | Normal (fasting)           | No action
100-125 mg/dL     | Prediabetes (fasting)      | Lifestyle counseling
126-139 mg/dL     | Diabetes (fasting)         | Confirm diagnosis
140-199 mg/dL     | Elevated (random)          | Further testing
200-250 mg/dL     | Hyperglycemia              | Medical evaluation
> 250 mg/dL       | Severe hyperglycemia       | Urgent care
> 600 mg/dL       | Hyperosmolar state         | Emergency

Relationship with HbA1c

Blood glucose and HbA1c should correlate:
{
  "HbA1c_level": 5.0,
  "blood_glucose_level": 90
}
// Both normal - consistent story

Example Patient Cases

{
  "blood_glucose_level": 85,
  "HbA1c_level": 4.9,
  "bmi": 22.0,
  "age": 30
}
Assessment: Healthy glucose levels, low diabetes risk

Feature Interactions

The model considers combinations of features:

High-Risk Combinations

Metabolic Syndrome Profile:
{
  "bmi": 32,              // Obese
  "hypertension": 1,       // High BP
  "blood_glucose_level": 120,  // Elevated
  "age": 55               // Middle age
}
All four components of metabolic syndrome present → Very high diabetes risk

Protective Combinations

Low-Risk Profile:
{
  "age": 28,
  "bmi": 21.5,
  "smoking_history": "never",
  "hypertension": 0,
  "HbA1c_level": 4.8
}
Young, healthy weight, non-smoker with excellent glucose control

Clinical Applications

Screening Decisions

Use feature values to determine screening intervals:
if age >= 45 or (age >= 35 and bmi >= 25):
    screen_now = True
    interval = "Every 3 years if normal"
else:
    screen_now = False
    interval = "Wait until age 45"

Intervention Priorities

Focus interventions based on modifiable features:
  1. BMI: Weight loss is first-line intervention
  2. Smoking: Cessation reduces risk and complications
  3. Blood Pressure: Control hypertension if present
  4. Glucose: Lifestyle changes to lower HbA1c
Non-modifiable (focus on monitoring):
  • Age
  • Gender
  • Heart disease history

Summary: Feature Importance

Based on medical literature and model feature importance:
Rank | Feature            | Modifiable | Impact
-----|--------------------|-----------|---------
1    | HbA1c_level        | Yes       | Very High
2    | blood_glucose      | Yes       | Very High
3    | bmi                | Yes       | High
4    | age                | No        | High
5    | hypertension       | Partial   | Moderate
6    | smoking_history    | Yes       | Moderate
7    | heart_disease      | Partial   | Moderate
8    | gender             | No        | Low

Next Steps

Model Architecture

Learn how these features are used in the RandomForest model

Data Preprocessing

Understand how features are encoded and scaled

Dataset Overview

See the full dataset structure and distribution

Quick Start

Start making predictions with these features

Build docs developers (and LLMs) love