In this homework, we explore both linear and logistic regression models.
Linear Regression
1) (20 points) Apply linear regression on both “diabetes” and “advertising” datasets and write a short paragraph about your findings.
2) (20 points) What is the linear regression model for each case?
Logistic Regression
1) (30 points) Use “bank” dataset and apply the logistic regression technique using the WEKA tool in 3 different settings, including:
a. 5 fold-cross validation.
b. 10 fold-cross validation.
c. 80% training.
Write a short paragraph about your findings and compare the results.
2) (30 points) Remove 3 features randomly from the dataset and repeat the same procedure (part 1) again.
• Your report including the screenshots of your implementation and the result.
| @relation bank | ||||||||
| @attribute age numeric | ||||||||
| @attribute sex {MALE | FEMALE} | |||||||
| @attribute region {INNER_CITY | RURAL | TOWN | SUBURBAN} | |||||
| @attribute income numeric | ||||||||
| @attribute married {YES | NO} | |||||||
| @attribute children {YES | NO} | |||||||
| @attribute car {YES | NO} | |||||||
| @attribute mortgage {YES | NO} | |||||||
| @attribute pep {YES | NO} | |||||||
| @data | ||||||||
| 48 | FEMALE | INNER_CITY | 17546 | NO | YES | NO | NO | YES |
| 40 | MALE | TOWN | 30085.1 | YES | YES | YES | YES | NO |
| 51 | FEMALE | INNER_CITY | 16575.4 | YES | NO | YES | NO | NO |
| 23 | FEMALE | TOWN | 20375.4 | YES | YES | NO | NO | NO |
| 57 | FEMALE | RURAL | 50576.3 | YES | NO | NO | NO | NO |
| 57 | FEMALE | TOWN | 37869.6 | YES | YES | NO | NO | YES |
| 22 | MALE | RURAL | 8877.07 | NO | NO | NO | NO | YES |
| 58 | MALE | TOWN | 24946.6 | YES | NO | YES | NO | NO |
| 37 | FEMALE | SUBURBAN | 25304.3 | YES | YES | YES | NO | NO |
| 54 | MALE | TOWN | 24212.1 | YES | YES | YES | NO | NO |
| 66 | FEMALE | TOWN | 59803.9 | YES | NO | NO | NO | NO |
| 52 | FEMALE | INNER_CITY | 26658.8 | NO | NO | YES | YES | NO |
| 44 | FEMALE | TOWN | 15735.8 | YES | YES | NO | YES | YES |
| 66 | FEMALE | TOWN | 55204.7 | YES | YES | YES | YES | YES |
| 36 | MALE | RURAL | 19474.6 | YES | NO | NO | YES | NO |
| 38 | FEMALE | INNER_CITY | 22342.1 | YES | NO | YES | YES | NO |
| 37 | FEMALE | TOWN | 17729.8 | YES | YES | NO | YES | NO |
| 46 | FEMALE | SUBURBAN | 41016 | YES | NO | NO | YES | NO |
| 62 | FEMALE | INNER_CITY | 26909.2 | YES | NO | NO | NO | YES |
| 31 | MALE | TOWN | 22522.8 | YES | NO | YES | NO | NO |
| 61 | MALE | INNER_CITY | 57880.7 | YES | YES | NO | NO | YES |
| 50 | MALE | TOWN | 16497.3 | YES | YES | NO | NO | NO |
| 54 | MALE | INNER_CITY | 38446.6 | YES | NO | NO | NO | NO |
| 27 | FEMALE | TOWN | 15538.8 | NO | NO | YES | YES | NO |
| 22 | MALE | INNER_CITY | 12640.3 | NO | YES | YES | NO | NO |
| 56 | MALE | INNER_CITY | 41034 | YES | NO | YES | YES | NO |
| 45 | MALE | INNER_CITY | 20809.7 | YES | NO | NO | YES | NO |
| 39 | FEMALE | TOWN | 20114 | YES | YES | NO | NO | YES |
| 39 | FEMALE | INNER_CITY | 29359.1 | NO | YES | YES | YES | NO |
| 61 | MALE | RURAL | 24270.1 | YES | YES | NO | NO | YES |
| 61 | FEMALE | RURAL | 22942.9 | YES | YES | NO | NO | NO |
| 20 | FEMALE | TOWN | 16325.8 | YES | YES | NO | NO | NO |
| 45 | MALE | SUBURBAN | 23443.2 | YES | YES | YES | NO | YES |
| 33 | FEMALE | INNER_CITY | 29921.3 | NO | YES | YES | NO | NO |
| 43 | MALE | SUBURBAN | 37521.9 | NO | NO | NO | NO | YES |
| 27 | FEMALE | INNER_CITY | 19868 | YES | YES | NO | NO | NO |
| 19 | MALE | RURAL | 10953 | YES | YES | YES | NO | NO |
| 36 | FEMALE | RURAL | 13381 | NO | NO | YES | NO | YES |
| 43 | FEMALE | TOWN | 18504.3 | YES | NO | YES | NO | NO |
| 66 | FEMALE | SUBURBAN | 25391.5 | NO | YES | NO | NO | NO |
| 55 | MALE | TOWN | 26774.2 | YES | NO | NO | YES | YES |
| 47 | FEMALE | INNER_CITY | 26952.6 | YES | NO | YES | NO | NO |
| 67 | MALE | TOWN | 55716.5 | NO | YES | YES | NO | YES |
| 32 | FEMALE | TOWN | 27571.5 | YES | NO | YES | YES | NO |
| 20 | MALE | INNER_CITY | 13740 | NO | YES | YES | YES | NO |
| 64 | MALE | INNER_CITY | 52670.6 | YES | YES | NO | YES | YES |
| 50 | FEMALE | INNER_CITY | 13283.9 | NO | YES | YES | NO | YES |
| 29 | MALE | INNER_CITY | 13106.6 | NO | YES | NO | YES | YES |
| 52 | MALE | INNER_CITY | 39547.8 | NO | YES | YES | NO | YES |
| 47 | FEMALE | RURAL | 17867.3 | YES | YES | YES | NO | NO |
| 24 | MALE | TOWN | 14309.7 | NO | YES | YES | NO | NO |
| 36 | MALE | TOWN | 23894.8 | YES | NO | NO | NO | NO |
| 43 | MALE | TOWN | 16259.7 | YES | YES | NO | NO | YES |
| 48 | MALE | SUBURBAN | 29794.1 | NO | YES | NO | NO | YES |
| 63 | MALE | TOWN | 56842.5 | YES | NO | NO | YES | NO |
| 52 | FEMALE | RURAL | 47835.8 | NO | YES | NO | NO | YES |
| 58 | FEMALE | INNER_CITY | 24977.5 | NO | NO | NO | NO | YES |
| 28 | MALE | INNER_CITY | 23124.9 | YES | NO | NO | NO | YES |
| 29 | FEMALE | INNER_CITY | 15143.8 | YES | NO | NO | NO | NO |
| 34 | MALE | INNER_CITY | 25334.3 | NO | YES | YES | YES | YES |
| 42 | FEMALE | INNER_CITY | 24763.3 | YES | YES | NO | YES | YES |
| 65 | FEMALE | INNER_CITY | 36589 | NO | YES | YES | NO | YES |
| 47 | MALE | INNER_CITY | 27022.6 | YES | YES | NO | NO | NO |
| 20 | MALE | INNER_CITY | 11700.4 | YES | NO | NO | NO | NO |
| 21 | MALE | TOWN | 5014.21 | NO | NO | YES | YES | NO |
| 42 | MALE | INNER_CITY | 17390.1 | YES | NO | NO | NO | NO |
| 19 | MALE | TOWN | 10861 | NO | YES | NO | NO | NO |
| 41 | FEMALE | TOWN | 34892.9 | NO | NO | NO | YES | NO |
| 30 | MALE | TOWN | 19403.1 | NO | YES | NO | NO | NO |
| 31 | FEMALE | RURAL | 10441.9 | YES | YES | NO | NO | YES |
| 25 | MALE | INNER_CITY | 14064.9 | YES | YES | YES | NO | NO |
| 21 | MALE | INNER_CITY | 8062.73 | NO | NO | NO | NO | YES |
| 36 | MALE | INNER_CITY | 31982 | YES | YES | YES | YES | YES |
| 58 | FEMALE | INNER_CITY | 23197.5 | YES | YES | NO | YES | NO |
| 64 | FEMALE | INNER_CITY | 52674 | NO | YES | YES | NO | YES |
| 59 | FEMALE | RURAL | 35610.5 | NO | YES | YES | NO | YES |
| 45 | FEMALE | TOWN | 26948 | NO | NO | NO | YES | NO |
| 61 | MALE | INNER_CITY | 49456.7 | YES | YES | YES | YES | YES |
| 30 | FEMALE | INNER_CITY | 14724.5 | YES | NO | YES | NO | NO |
| 58 | FEMALE | TOWN | 34524.9 | YES | YES | YES | NO | YES |
| 50 | FEMALE | TOWN | 22052.1 | NO | YES | NO | NO | YES |
| 30 | MALE | INNER_CITY | 27808.1 | NO | YES | NO | NO | NO |
| 29 | FEMALE | INNER_CITY | 12591.4 | YES | YES | NO | NO | NO |
| 35 | MALE | INNER_CITY | 16394.4 | YES | YES | NO | NO | YES |
| 62 | MALE | INNER_CITY | 24026.1 | YES | NO | NO | YES | YES |
| 36 | MALE | INNER_CITY | 31683.1 | YES | YES | YES | NO | YES |
| 25 | FEMALE | INNER_CITY | 15525 | YES | NO | NO | NO | NO |
| 66 | FEMALE | TOWN | 22562.2 | NO | NO | YES | YES | NO |
| 30 | MALE | SUBURBAN | 15848.7 | YES | NO | YES | YES | NO |
| 54 | FEMALE | INNER_CITY | 31095.6 | YES | YES | NO | NO | YES |
| 37 | MALE | TOWN | 24814.5 | YES | YES | YES | YES | YES |
| 28 | FEMALE | INNER_CITY | 25429.3 | NO | YES | NO | YES | NO |
| 53 | FEMALE | RURAL | 34866.5 | NO | NO | NO | NO | YES |
| 61 | MALE | INNER_CITY | 42579.1 | YES | YES | YES | NO | NO |
| 61 | FEMALE | INNER_CITY | 41127.4 | YES | NO | YES | NO | NO |
| 18 | FEMALE | INNER_CITY | 9990.11 | YES | NO | NO | NO | NO |
| 22 | MALE | INNER_CITY | 7948.62 | YES | YES | NO | YES | NO |
| 34 | MALE | TOWN | 30870.8 | YES | YES | YES | YES | YES |
| 35 | FEMALE | INNER_CITY | 12125.8 | NO | YES | NO | NO | NO |
| 18 | FEMALE | RURAL | 15348.9 | YES | NO | YES | NO | NO |
| 54 | MALE | INNER_CITY | 26707.9 | YES |

Leave a Reply