Question: You have to devise an Object Oriented solution for this problem, i . e . you MUST create a CLASS, and solve the problem calling

You have to devise an Object Oriented solution for this problem, i.e. you MUST create a CLASS, and
solve the problem calling the class methods.
The train dataset contains data regarding a train crash. It has ~891 records. However, all records are not
complete, i.e. some have missing data. In this data set, our outcome of interest is the survived column,
on whether an individual survived (1) or died (0) after the Train crash.
1. Clean the data and remove any unwanted records. How many records do you have now?
(20 points)
2. The train picked most passengers from which station ?
(20 points)
3. Do some basic data exploration (e.g. using commands as head(), info(), describe(), nunique(), etc).
Which variables will you NOT select?
(20 points)
4. Are there any outliers in the data? If yes, treat them.
(15 points)
5. Partition the data into a training set (with 70% of the observations), and testing set (with 30% of the
observations) using the random state of 12345 for cross validation. (15 points)
6. On the partitioned data, build the best KNN model. Show the accuracy numbers. (Hint: What is the
best value of k? How do you decide the best k?)
(30 points)
7. On the partitioned data, build the best logistic regression model. Show the accuracy numbers.
(30 points)
8. On the partitioned data, build the decision tree. Show the accuracy numbers. What tree depth did
you choose, i.e. which one is ideal and why? (30 points)
9. Based on the results of k-nearest neighbor, and logistic regression, what is the best model to classify
the data? Provide explanation to support your argument. (20 points)
10. Show some interesting graphs of the data, i.e., that can describe the original data survived pclass sex age sibsp parch fare station. By using TrainData excell data bsurvived pclass sex age sibsp parch fare station.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!