T. Roelofs
17 June
The Boston Housing Data Set was gathered by Harrison, D. and Rubinfeld, D.L. for their study 'Hedonic prices and the demand for clean air' (Journal for Environmental Economics & Management, vol.5, p 81-102) in 1978. In the data set several variables were measured that influence house prices in Boston (and throughout the whole world).
The data set can be obtained at archive.ics.uci.edu/ml/datasets/housing. Furthermore, the data set is contained in the MASS package, which we will use in the App.
The user of the App can do the following:
The following code is used to generate the models:
model_gbm <- train(MEDV ~ ., method="gbm", data = Boston_data, verbose=FALSE)
model_pls <- train(MEDV ~ ., method ="pls", data= Boston_data, verbose=FALSE)
The predictions can be generated with input data frames:
input_values <- data.frame(50, 12,12,0,0.5,6,70,5,10,500,20,300,13)
colnames(input_values) <- c("CRIM", "ZN", "INDUS", "CHAS", "NOX", "RM", "AGE", "DIS", "RAD", "TAX", "PRATIO", "B", "LSTAT")
pred_pls <- predict(model_pls, newdata = input_values)
pred_gbm <- predict(model_gbm, newdata = input_values)
print(pred_pls)
[1] 19.86858