Machine learning-Linear regression

Hi, guys this is my first machine learning model using linear regression...

Introduction:

In this model we will predict the insurance amount to be paid by the new customer from a given datasets. Myself download the ACME insurance datasets from the github you can try any other datasets. Let's predict the insurance amount paid by the new customers.

Relation between the data:

Let's analysis the some of the data using visualization technique.




By analyzing the data there is a strong relation between smoker and charges.

Scikit learn:

It is one of the powerfull machine learning library in the field of data science. In this problem we use this to calculate linear regression(y=mx+c) model, and also using OneHotEncoder to convert multiple object into calculatable values.


By understanding the line is just above the cluster this is due to the outliers. This is the simple regression line once we find for single varriable we can easily do it for multiple variable using scikit-learn.

Loss:

Once we predict the model we also compare the result with actual one and find the loss by creating the function of root mean squared error.

Conclusion:

By training the model, predicting the value and comparing the value with loss which improve the model efficiency. And try to include all the values and by using One Hot encoder or creating a dictionary for two variable data and torture the data to extract the information. You can also find more linear regression problem in my github repository.

Source code of the Linear regression-projects: Machine-learning-Linear-regression

Comments

Popular posts from this blog

Best practice to follow on git and github

Deep learning with TensorFlow

Image classification(Fastbook notebook_2)