Project 1
1.The data is medical insurance charges, with each row representing a single patient and various features about that patient. The features included in this dataset are:
This is a supervised learning problem, as the data includes both input features and a target output (the charges). The goal of a supervised learning model applied to this data would be to train a model that can predict the insurance charges for new patients based on their age, sex, BMI, number of children, smoking status, and region
2.The minimum sample size n required for 99% accurate predictions can be calculated using the formula:
n = (Z^2 * p * (1-p)) / e^2
Since the proportion p of the population is unknown, it can be estimated as 0.5. With a precision of 0.02 and Z = 2.576, we get:
n = (2.576^2 * 0.5 * (1-0.5)) / 0.02^2 = 165.67
Therefore, the minimum sample size required for 99% accurate predictions with a precision of 0.02 is approximately 326 individuals.
3. It appears that the data is already in a cleaned format with no null values, row or column duplicates, or outliers.
4.If the p-value of the test is less than a predetermined significance level (such as 0.05), then you can reject the null hypothesis and conclude that sex and smoking are not independent.
Chi-Square Statistic: 7.39291081459996
P-value: 0.006548143503580696
5.These tests determine the degree of association between two variables, with a value close to 1 indicating a strong positive correlation, a value close to -1 indicating a strong negative correlation, and a value close to 0 indicating no correlation.
6.The dependency between the response and the regressors and determine which regressors are important in explaining the variation in the response.
7. After fitting the regression model, we can use it to predict insurance charges for new observations by providing values for the independent variables.
8.0 indicates that the model does not explain any of the variability of the response data around its mean. 1 indicates that the model explains all the variability of the response data around its mean. In practical terms, an R2 score closer to 1 indicates a better fit of the model to the data, while a score closer to 0 indicates a poorer fit.In thsi experiment I got 0.710161080769421.
9.This code will print the MAPE as a percentage, which represents the average percentage difference between the predicted and actual value is 79.41%
10. 95% confidence interval for the average insurance charge (-10455.892302350225, 36996.73683263274)