Lab 6
Lab 6
a. Create a regression model using ‘citympg’ as the dependent variable and ‘horsepower’ as the
independent variable. Report all model statistics and comment on the model diagnostics.
b. Create the same regression model keeping ‘highwaympg’ as the dependent variable and ‘horsepower’
as the independent variable. Report all model statistics and comment on the model diagnostics.
c. Include a basic scatterplot of the data for both above as well.
d. Create another regression model using ‘citympg’ and ‘highwaympg’ as independent variables
separately and ‘price’ as the dependent variable. Examine in your both regression models whether these
data are positively or negatively correlated or not.
e. Create a regression model using two other variables from the ‘CarPrice_Assignment.csv’ dataset (i.e.,
not ‘highwaympg’, ‘citympg’ or ‘horsepower’ as independent variable). You can keep ‘price’ as
dependent variable. Take any other two separately as independent variable and create two separate
regression model if it can be ensured the existence of a reasonable underlying connection between the
independent and dependent variables.
f. Report all model statistics and comment on the model diagnostics. (20 Min)
3. Create two columns using random function. First as actual values and second as predicted values.
School of Computer Science Engineering and Technology
a) On these values find accuracy, f1-score and precision respectively.
b) Create a confusion matrix and display the confusion matrix. Display the error graph between actual and
predicted values.
c) Using confusion matrix find True positive, False positive, True Negative and False Negative. Using these
values plot a ROC curve. . (20 Min)