Below is the dataset for which I am trying to implement Linear regression in python.
age sex bmi children smoker region charges
0 19 female 27.900 0 yes southwest 16884.92400
1 18 male 33.770 1 no southeast 1725.55230
2 28 male 33.000 3 no southeast 4449.46200
3 33 male 22.705 0 no northwest 21984.47061
4 32 male 28.880 0 no northwest 3866.85520
I am confused what to do with the columns children, smoker, sex as they are of type "object".
Data columns (total 7 columns):
age 1338 non-null int64
sex 1338 non-null object
bmi 1338 non-null float64
children 1338 non-null int64
smoker 1338 non-null object
region 1338 non-null object
charges 1338 non-null float64
Do I have to convert this to numeric before building my model ? Please provide your suggestions.
Thank you.