hpipy.utils.metrics.accuracy#

class hpipy.utils.metrics.accuracy(hpi_obj, test_method='insample', test_type=None, pred_df=None, smooth=False, in_place=False, in_place_name='accuracy', **kwargs)[source]

Bases:

Calculate the accuracy of an index.

Parameters:
  • hpi_obj (BaseHousePriceIndex) – Index object.

  • test_method (str, optional) – Testing method. Defaults to “insample”. Also supports “kfold”.

  • test_type (str, optional) – Testing type. Defaults to None. If None, the test_type is inferred from the index object.

  • pred_df (TransactionData | pd.DataFrame | None, optional) – Prediction data. Defaults to None.

  • smooth (bool, optional) – Smooth the index. If True, the revision is calculated based on the smoothed indices. Defaults to False.

  • in_place (bool, optional) – Return accuracy in-place. Defaults to False.

  • in_place_name (str, optional) – Name of the attribute to store the accuracy in. Defaults to “accuracy”.

  • **kwargs – Additional keyword arguments.

Returns:

Index object containing the

accuracy or DataFrame.

Return type:

BaseHousePriceIndex | pd.DataFrame

__call__(**kwargs)

Call self as a function.

__init__(**kwargs)