Description Usage Arguments Examples
Given a listing ID, predictPrice
uses the xgboost
package to predict a price
for that listing based on its characteristics and data from nearby listings. A listing ID can be found
on the end of the URL for the listing on Airbnb's site. For example, a listing URL for Airbnb
looks like https://www.airbnb.com/rooms/17634206?s=QAXAT6DD
. In this example, the listing
ID is "17634206." Passing this value as a character string will yield a price prediction based
on its characteristics, implying over- or undervaluation.
1 2 3 | predictPrice(listingID, maxSample = 500, nfold = 10, nrounds = 1000,
early_stopping_rounds = 50, max_depth = 4, eta = 0.05,
listing.detail = NULL, trainData = NULL)
|
listingID |
the ID that Airbnb has assigned to the listing. This can be taken from the end of a listing's URL. This should be passed as a string (a character vector of length one). |
maxSample |
The maximum number of nearby listings on which to base the price prediction. There is a tradeoff-a higher value will increase prediction precision, but it will take longer to run. |
nfold |
For advanced users. The number of cross validation folds used by |
nrounds |
For advanced users. The maximum number of rounds that |
early_stopping_rounds |
For advanced users. This parameter will cause xgboost to stop training new models after the specified number of rounds if cross validation error does not improve. |
max_depth |
For advanced users. The maximum depth of a tree fitted by |
eta |
For advanced users. The shrinkage parameter used to control the learning rate for
|
listing.detail |
a dataset for the particular listing if you've already pulled it using
|
trainData |
a dataset consisting of listings with details if you've already pulled it
using |
1 2 3 4 | data("trainData", package="Rbnb")
data("listing.detail", package="Rbnb")
price.prediction <- Rbnb::predictPrice("12170773",
listing.detail = listing.detail, trainData = trainData[1:100])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.