Task 2: Model Fitting

Model Fitting

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

The task is to predict the sf price onto the holdout dataset where the sf column is not present

Exploratory Analysis

head(training_data[2:11])
        X1        X2   X3 runners favourite favourite_cloth_number jumps.flat
1 3.750000 29.000000 10.0       6  1.444444                      6       Flat
2 4.500000  2.750000 13.0       9  2.750000                      3       Flat
3 4.000000  1.727273  8.0       5  1.727273                      4       Flat
4 1.727273  7.500000  5.0       6  1.727273                      5       Flat
5 2.500000  6.500000  6.5       5  2.500000                      2       Flat
6 2.500000  3.000000  4.0       5  2.500000                      4      Jumps
  places expert_opinion    sf
1      2             NA 63.98
2      3             NA 11.27
3      2             NA  6.05
4      2             NA  7.07
5      2             NA 10.67
6      2             NA  5.29
head(holdout_data[2:10])
      X1        X2   X3 runners favourite favourite_cloth_number jumps.flat
1  3.750  4.500000  3.5       7  3.500000                      3      Jumps
2  5.500  1.250000 13.0       3  1.250000                      1      Jumps
3  4.500 10.000000  6.0       8  3.500000                      5       Flat
4  9.000  4.333333  5.0      13  4.333333                     12       Flat
5  2.375  2.750000  7.0       5  2.375000                      4      Jumps
6 13.000  8.000000 26.0      16  3.750000                      9      Jumps
  places expert_opinion
1      2             NA
2      0             NA
3      2             NA
4      3             NA
5      2             NA
6      4             NA

The echo: false option disables the printing of code (only output is displayed).

Data Preparation

Model Selection

Model Testing