age
int64
18
64
sex
stringclasses
2 values
bmi
float64
16
53.1
children
int64
0
5
smoker
stringclasses
2 values
region
stringclasses
4 values
charges
float64
1.12k
63.8k
19
female
27.9
0
yes
southwest
16,884.924
18
male
33.77
1
no
southeast
1,725.5523
28
male
33
3
no
southeast
4,449.462
33
male
22.705
0
no
northwest
21,984.47061
32
male
28.88
0
no
northwest
3,866.8552
31
female
25.74
0
no
southeast
3,756.6216
46
female
33.44
1
no
southeast
8,240.5896
37
female
27.74
3
no
northwest
7,281.5056
37
male
29.83
2
no
northeast
6,406.4107
60
female
25.84
0
no
northwest
28,923.13692
25
male
26.22
0
no
northeast
2,721.3208
62
female
26.29
0
yes
southeast
27,808.7251
23
male
34.4
0
no
southwest
1,826.843
56
female
39.82
0
no
southeast
11,090.7178
27
male
42.13
0
yes
southeast
39,611.7577
19
male
24.6
1
no
southwest
1,837.237
52
female
30.78
1
no
northeast
10,797.3362
23
male
23.845
0
no
northeast
2,395.17155
56
male
40.3
0
no
southwest
10,602.385
30
male
35.3
0
yes
southwest
36,837.467
60
female
36.005
0
no
northeast
13,228.84695
30
female
32.4
1
no
southwest
4,149.736
18
male
34.1
0
no
southeast
1,137.011
34
female
31.92
1
yes
northeast
37,701.8768
37
male
28.025
2
no
northwest
6,203.90175
59
female
27.72
3
no
southeast
14,001.1338
63
female
23.085
0
no
northeast
14,451.83515
55
female
32.775
2
no
northwest
12,268.63225
23
male
17.385
1
no
northwest
2,775.19215
31
male
36.3
2
yes
southwest
38,711
22
male
35.6
0
yes
southwest
35,585.576
18
female
26.315
0
no
northeast
2,198.18985
19
female
28.6
5
no
southwest
4,687.797
63
male
28.31
0
no
northwest
13,770.0979
28
male
36.4
1
yes
southwest
51,194.55914
19
male
20.425
0
no
northwest
1,625.43375
62
female
32.965
3
no
northwest
15,612.19335
26
male
20.8
0
no
southwest
2,302.3
35
male
36.67
1
yes
northeast
39,774.2763
60
male
39.9
0
yes
southwest
48,173.361
24
female
26.6
0
no
northeast
3,046.062
31
female
36.63
2
no
southeast
4,949.7587
41
male
21.78
1
no
southeast
6,272.4772
37
female
30.8
2
no
southeast
6,313.759
38
male
37.05
1
no
northeast
6,079.6715
55
male
37.3
0
no
southwest
20,630.28351
18
female
38.665
2
no
northeast
3,393.35635
28
female
34.77
0
no
northwest
3,556.9223
60
female
24.53
0
no
southeast
12,629.8967
36
male
35.2
1
yes
southeast
38,709.176
18
female
35.625
0
no
northeast
2,211.13075
21
female
33.63
2
no
northwest
3,579.8287
48
male
28
1
yes
southwest
23,568.272
36
male
34.43
0
yes
southeast
37,742.5757
40
female
28.69
3
no
northwest
8,059.6791
58
male
36.955
2
yes
northwest
47,496.49445
58
female
31.825
2
no
northeast
13,607.36875
18
male
31.68
2
yes
southeast
34,303.1672
53
female
22.88
1
yes
southeast
23,244.7902
34
female
37.335
2
no
northwest
5,989.52365
43
male
27.36
3
no
northeast
8,606.2174
25
male
33.66
4
no
southeast
4,504.6624
64
male
24.7
1
no
northwest
30,166.61817
28
female
25.935
1
no
northwest
4,133.64165
20
female
22.42
0
yes
northwest
14,711.7438
19
female
28.9
0
no
southwest
1,743.214
61
female
39.1
2
no
southwest
14,235.072
40
male
26.315
1
no
northwest
6,389.37785
40
female
36.19
0
no
southeast
5,920.1041
28
male
23.98
3
yes
southeast
17,663.1442
27
female
24.75
0
yes
southeast
16,577.7795
31
male
28.5
5
no
northeast
6,799.458
53
female
28.1
3
no
southwest
11,741.726
58
male
32.01
1
no
southeast
11,946.6259
44
male
27.4
2
no
southwest
7,726.854
57
male
34.01
0
no
northwest
11,356.6609
29
female
29.59
1
no
southeast
3,947.4131
21
male
35.53
0
no
southeast
1,532.4697
22
female
39.805
0
no
northeast
2,755.02095
41
female
32.965
0
no
northwest
6,571.02435
31
male
26.885
1
no
northeast
4,441.21315
45
female
38.285
0
no
northeast
7,935.29115
22
male
37.62
1
yes
southeast
37,165.1638
48
female
41.23
4
no
northwest
11,033.6617
37
female
34.8
2
yes
southwest
39,836.519
45
male
22.895
2
yes
northwest
21,098.55405
57
female
31.16
0
yes
northwest
43,578.9394
56
female
27.2
0
no
southwest
11,073.176
46
female
27.74
0
no
northwest
8,026.6666
55
female
26.98
0
no
northwest
11,082.5772
21
female
39.49
0
no
southeast
2,026.9741
53
female
24.795
1
no
northwest
10,942.13205
59
male
29.83
3
yes
northeast
30,184.9367
35
male
34.77
2
no
northwest
5,729.0053
64
female
31.3
2
yes
southwest
47,291.055
28
female
37.62
1
no
southeast
3,766.8838
54
female
30.8
3
no
southwest
12,105.32
55
male
38.28
0
no
southeast
10,226.2842
56
male
19.95
0
yes
northeast
22,412.6485
38
male
19.3
0
yes
southwest
15,820.699

Dataset Card for Medical Insurance Cost Prediction

The medical insurance dataset encompasses various factors influencing medical expenses, such as age, sex, BMI, smoking status, number of children, and region. This dataset serves as a foundation for training machine learning models capable of forecasting medical expenses for new policyholders.

Its purpose is to shed light on the pivotal elements contributing to increased insurance costs, aiding the company in making more informed decisions concerning pricing and risk assessment.

Dataset Description

The dataset contains 2.7K rows and 7 columns Columns include

  1. Age
  2. Sex
  3. BMI (Body Mass Index)
  4. Children
  5. Smoker
  6. Region
  7. Charges

Introduction

Healthcare costs are a significant concern for individuals and families worldwide. Predicting medical insurance costs accurately can help insurance companies determine premiums and assist individuals in planning their healthcare expenses. This project focuses on building machine learning models to predict insurance costs based on demographic and health-related attributes.

Problem Statement

  1. What are the most important factors that affect medical expenses?
  2. How well can machine learning models predict medical expenses?
  3. How can machine learning models be used to improve the efficiency and profitability of health insurance companies?

Features

  • Data Exploration: Explore the dataset to understand its structure, identify missing values, and analyze the distribution of features.
  • Data Preprocessing: Prepare the data by handling categorical variables, renaming columns, and scaling numerical features.
  • Model Training: Utilize linear regression and ridge regression models to train predictive models on the prepared dataset.
  • Pipeline Construction: Construct a data preprocessing pipeline to streamline the process of transforming input data for model training.
  • Model Evaluation: Evaluate model performance using metrics such as R-squared score and mean squared error to assess predictive accuracy.
  • Model Serialization: Save trained models and pipelines to disk using the pickle library for future use.

Technologies Used

  • Python: Programming language used for data manipulation, analysis, and model implementation.
  • Libraries: NumPy, Pandas, Seaborn, Matplotlib, and Scikit-learn for data handling, visualization, and machine learning tasks.
  • Machine Learning Models: Linear Regression, Ridge Regression
  • Pickle: Python library used for serializing trained models and pipelines to disk.

Dataset Sources

From multiple online and offline datasets

Problem Statement

  1. What are the primary factors influencing medical expenses?
  2. How accurate are machine learning models in predicting medical expenses?
  3. In what ways can machine learning models enhance the efficiency and profitability of health insurance companies?
Downloads last month
50