Question 9
Consider the following ML task/steps for a regression dataset:
1. Read the data from a file (named ‘dataset.csv’). It has 7 columns. The last column is the target variable, the rest of them are numerical features.
2. Drop rows with missing values.
3. After removing samples with missing values split the data into training and test sets. Take about the first 80% of rows in the training set and the rest of them into the test set.
4. Train a simple linear regression model, with intercept, on the training set.
5. Report R2 score on the test set.
Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.