$25
Q1. In this assignment, you need to find the total cost of traveling from the start node to the end node using breadth-first search and depth-first search using prolog. Given here the start node as node “0” and the end node be “4”. The edge connecting any two nodes depicts the cost between those two nodes: (5)
Q2. In the given CSV it is insurance data which consists of the following columns: (5)
• age: age of the primary beneficiary.
• sex: insurance contractor gender, female, male.
• BMI: Body mass index, providing an understanding of the body, weights that are relatively high or low relative to height, an objective index of body weight (kg / m ^ 2) using the ratio of height to weight, ideally 18.5 to 24.9.
• children: Number of children covered by health insurance / Number of dependents.
• smoker: Smoking.
• region: the beneficiary's residential area in the US, northeast, southeast, southwest, and northwest.
• charges: Individual medical costs billed by health insurance.
• Divide the data into 80:20 ratio and use 80% of the data as training and the rest as testing data.
➢ Apply a linear regression model to the following data and predict the accuracy and mean absolute error. You can also apply a few preprocessing to the data to increase the accuracy.
Q3. For this question you have to use the Diabetes dataset. (5) Divide the data into a 70:30 ratio and use 70% of the data as training and the rest as testing data.
(a) Visualize and analyze the dataset (use plots to visualize the data).
(b) Apply a logistic regression model to the following data and predict the accuracy.
Print the training and testing accuracy, and confusion matrix for the same.