Question on sex, region and smoke

While did we use 0 and 1 for sex and smoke and use one hit encoder for region.

Cant we use one hot encoder for all the 3 variables?

What’s the purpose of One Hot Encoding?
We do one hot encoding to remove biases from the data, suppose there are 10 categories in a column. A category was labelled 1 and another category was labelled 9. While these represent category and these are just numbers(we know) but the computers don’t identify them as just numbers rather it think the number is a weighted value for the category ie. Our model will see the category with label 9 has more weight w.r.t to the category labelled as 1(which is not the case right? The region ‘New York’ labelled as 9 will not necessarily have more weight/impact on the data than ‘California’ labelled as 1). In this case we do One Hot Encoding to keep the values of the categories in 0’s and 1’s. Basically, for 10 categories we make 10 different columns and fill the value as 1 for the category a row belongs to where as all other column values are set to 0 for that row. These confirms that the data remains in the range of 0 and 1. Now for a column which has only two category we can encode them using one hot encoding too but even without encoding it will have either 0 or 1 value, so we won’t need to encode the columns like sex and region. Nevertheless you can do so and it shouldn’t affect the model.