predict_price: Create a new "pred" object

Description Usage Arguments Value Author(s) Examples

View source: R/immodata.R

Description

This function enables to predict the prices of housings based on their number of rooms, size in square meters, city and using a particular model. The user can provide either a dataframe in the form of the ones outputted by the get_immodata or providing only rooms, m2 and city of a single housing.

Usage

1
predict_price(housings, rooms, m2, city, model = "rf", seed = 1)

Arguments

housings

A dataframe in the form of the ones outputted by the get_immodata function.

rooms

The number of rooms for a single housing estimation

m2

The number of m2 for a single housing estimation

city

The city of a single housing estimation

model

A model supported by the caret function for regression ("gam", "rf", "nnet", "svmRadialCost", "rpart", ...)

seed

The seed to use

Value

A "pred" object of the expected prices of all observations of the dataframe or the single housing

Author(s)

Germano David

Lomazzi Vincent

Bron Luca

Raisin Edgar

Grandadam Patrik

Examples

1
2
3
cities <- get_immodata(c("bussigny", "nyon"))
predict_price(cities) # based on a dataframe
predict_price(rooms = 3, m2 = 59, city = "nyon") # for an unique housing

vincentlomazzi/swissimmo documentation built on May 13, 2019, 9:53 p.m.