We will be able to predict the insurance amount for a person.
We start by importing necessary modules as shown:
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import accuracy_score
Then import the data.
data=pd.read_csv('insurance.csv')data
Clean the data by removing duplicate values and transform the columns into numerical values to make the easier to work with.
After splitting the model choose the suitable algorithm. In this case we will use Linear Regression since we need to predict a numerical value based on some parameters.