hpipy.extensions.RandomForestModel#
- class hpipy.extensions.RandomForestModel(hpi_data, **kwargs)[source]
- Bases: - BaseHousePriceModel- Random forest house price model. - Methods - Initialize base house price model. - Fit the random forest model and generate index coefficients. - Attributes - Parameters:
- hpi_data (TransactionData) 
- kwargs (Any) 
 
 - fit(dep_var=None, ind_var=None, estimator='pdp', log_dep=True, n_estimators=100, quantile=None, random_seed=0, **kwargs)[source]
- Fit the random forest model and generate index coefficients. - Parameters:
- dep_var (str | None, optional) – Dependent variable. Defaults to None. 
- ind_var (list[str] | None, optional) – Independent variable(s). Defaults to None. 
- estimator (str, optional) – Estimator type. Defaults to “pdp”. 
- log_dep (bool, optional) – Log transform the dependent variable. Defaults to True. 
- n_estimators (int, optional) – Number of estimators. Defaults to 100. 
- quantile (float | None, optional) – Quantile to compute. Defaults to None. 
- random_seed (int, optional) – Random seed to use. Defaults to 0. 
- kwargs (Any) 
 
- Returns:
- Fitted model. 
- Return type:
- Self 
 
 - __init__(hpi_data, **kwargs)
- Initialize base house price model. - Parameters:
- hpi_data (TransactionData) 
- kwargs (Any) 
 
- Return type:
- None 
 
 - coefficients: DataFrame
 - model_obj: Any
 - periods: DataFrame
 - base_price: float