8.12Exercise
In the Chapter 4 exercise, you used a data set that contained information about cars. For this exercise, we will enhance this data set and then build a linear regression model on it. Complete the following steps:

Open the data set for the Chapter 4 exercise (car data) in your spreadsheet program.

Split your data set's observations in two: a training portion and a scoring portion. Give the training portion 261 observations and put the other 135 observations in the scoring portion. Save these as two separate CSV files with descriptive names.

Import both of your data sets into your RapidMiner repository or connect to them via Read CSV. Add them to a new process and rename them "Training" and "Scoring" so you can tell them apart.

Use a Set Role operator to designate the MPG attribute as the label for the training data, if you did not designate MPG as the label during data import. Do not designate MPG as the label in the scoring data.

Add a linear regression operator and apply your model to your scoring data set.

Run your model. In Results perspective, examine your attribute coefficients and the predictions for the cars in your scoring data set.

Report your results:

Which attributes have the greatest predictive power?

Were any attributes dropped from the data set as nonpredictors? If so, which ones and why do you think they weren't effective predictors?

Compare the predicted MPG values to the actual MPG values in the scoring data set. How close are the predictions? On average, how far off are your model's predictions?

What other attributes do you think would help your model better predict fuel efficiency?


Open the R Console and construct the same linear regression model in R. Examine the model to determine if any predictor attributes should be dropped. Determine the statistical significance and predictive ability of your model. Apply your model to your cars scoring data. Repeat step 7 above using your results in R.