Skip to main content

Ratio Study for Computer Assisted Mass Appraisal (CAMA) models

Ratio-Study is software package for Python developed by the Municipal Property Assessment Corporation (MPAC) of Ontario, Canada. It has been developed and is maintained by ASMA-DS: the Data Science team within the Assessment Standards and Mass Appraisal Department at MPAC.

This package provides a comprehensive suite of functions for evaluating Computer Assisted Mass Appraisal (CAMA) real estate valuation models. These functions comprise but are not limited to the International Association of Assessing Officers (IAAO)' Standard on Ratio Studies, as well as recent advances in this area.

Backend support (pandas / polars / pyarrow)

The package is backend-agnostic thanks to narwhals. Public functions (ratios, rts_calculator, asr_median, cod, prd, prb, rmse, mae, CoC, CoV_adj, vei_analysis, vem, gini_stats, gini_decomp, gini_factors, bo_decompose, bo_multi_decomposition, compare_ratios, etc.) accept any of the following:

  • pandas.DataFrame (default)
  • polars.DataFrame
  • pyarrow.Table
  • A narwhals-wrapped frame (narwhals.DataFrame / narwhals.LazyFrame)
  • 1D values can be any of: numpy.ndarray, pandas.Series, polars.Series, narwhals.Series, or a plain list.

Where the input is a polars / pyarrow / narwhals frame, the result is returned in the same backend so you can keep your pipeline native.

A few third-party libraries remain pandas-only, so the package converts at the function boundary where needed:

  • seaborn (used in graphs.py)
  • xlsxwriter via pd.ExcelWriter (used in reporting.py)
  • statsmodels.formula.api.ols (used in gini_factors)
import polars as pl
from ratio_study import ratios, load_sample_dataset

# Load a polars DataFrame from the bundled parquet sample
df = load_sample_dataset("polars")

# Compute IAAO ratio indicators — result is a polars.DataFrame
result = ratios(
    df,
    market_value_header="time_adjusted_sale_price",
    assessment_header="assessment_value_new",
    list_of_indicators=["Median", "Mean", "CoD", "PRD", "PRB"],
    group_by="property_type",
)
print(result.to_dicts())

Disclaimer

This package is provided free of charge, "as is", without warranty of any kind, express or implied, including but not limited to warranties of accuracy, fitness for a particular purpose, merchantability or non-infringement. See the LICENSE (GPL-3.0-or-later) for the full terms.

This package is not an official publication of, and is not endorsed by, the International Association of Assessing Officers (IAAO). References to the IAAO Standard on Ratio Studies describe how the package interprets it; consult the Standard itself. Sample data bundled with the package is anonymised and synthetic in its coordinates; it is for demonstration only.

References

IAAO's Standard on Ratio Studies available at https://www.iaao.org/media/standards/Standard_on_Ratio_Studies.pdf

Thomas J. DiCiccio. Bradley Efron. "Bootstrap confidence intervals." Statist. Sci. 11 (3) 189 - 228, August 1996. https://doi.org/10.1214/ss/1032280214

Quintos, C. (2020). A Gini measure for vertical equity in property assessments. Journal of Property Tax Assessment & Administration, 17(2). Retrieved from https://researchexchange.iaao.org/jptaa/vol17/iss2/2

Quintos, C. (2021). A Gini decomposition of the sources of inequality in property assessments. Journal of Property Tax Assessment & Administration, 18(2). Retrieved from https://researchexchange.iaao.org/jptaa/vol18/iss2/6

Formulas on article by David Zaslavsky, retrieved from https://www.ellipsix.net/blog/2012/11/the-gini-coefficient-for-distribution-inequality.html

Metadata

Release files for ratio-study 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ratio-study 1.0.2
File Size Uploaded Provenance Actions
ratio_study-1.0.2.tar.gz 1.1 MB Without provenance Details for ratio_study-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ratio-study 1.0.2
File Interpreter ABI Platform Actions
ratio_study-1.0.2-py3-none-any.whl Python 3 none any Details for ratio_study-1.0.2-py3-none-any.whl

Total release size: 2.2 MB

Release files / ratio_study-1.0.2.tar.gz

Download URL ratio_study-1.0.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
deb45e567945052dcecc3fa3e2222a60b2000f05841bd510712d60c5626db9a9
BLAKE2b-256 checksum
How to use checksums
d5cbdb8f51ac4f1bb493ec89026646ff95759bd787cc32cd3edeecee236cec7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / ratio_study-1.0.2-py3-none-any.whl

Download URL ratio_study-1.0.2-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2fd5093f68a68a2adada11753eeb378233fcdf5fafcb81a367f087f373aa17e0
BLAKE2b-256 checksum
How to use checksums
08f5bbcd979d319004fd7cf26e485bd165f695d3002d2240affddc944a234e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for ratio-study 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page