Skip to main content

PYRSM

Python functions and classes for Business Analytics at the Rady School of Management (RSM), University of California, San Diego (UCSD).

Features

Basics Module - Statistical tests and analyses:

  • compare_means - Compare means across groups (t-tests, ANOVA)
  • compare_props - Compare proportions between groups
  • correlation - Correlation analysis with significance tests
  • cross_tabs - Cross-tabulation with chi-square tests
  • goodness - Goodness of fit tests
  • single_mean - Single sample mean tests
  • single_prop - Single sample proportion tests
  • prob_calc - Probability calculator for common distributions

Model Module - Regression and machine learning:

  • regress - Linear regression with statsmodels
  • logistic - Logistic regression with statsmodels
  • mlp - Multi-layer perceptron (neural network) with sklearn
  • rforest - Random forest with sklearn
  • xgboost - XGBoost gradient boosting

EDA Module - Exploratory data analysis:

  • explore - Data exploration and summary statistics
  • pivot - Pivot tables
  • visualize - Data visualization

All modules use Polars DataFrames and plotnine for visualization.

Installation

Requires Python 3.12+ and UV:

mkdir ~/project
cd ~/project
uv init .
uv venv --python 3.13
source .venv/bin/activate
uv add pyrsm

For machine learning models, install with extras:

uv add "pyrsm[ml]"

For all features:

uv add "pyrsm[all]"

If you cloned pyrsm and was to add it in editable format use:

uv add --editable --dev /home/vnijs/gh/pyrsm`

To add to a specific (project) folder use:

uv add --project /opt/base-uv pyrsm`

Quick Start

import polars as pl
import pyrsm as rsmi

# Load data
df = pl.read_parquet("data.parquet")

# Statistical test
cm = rsm.basics.compare_means(df, var="price", byvar="category")
cm.summary()
cm.plot()

# Regression model
reg = rsm.model.regress(df, rvar="price", evar=["size", "age", "type"])
reg.summary()
reg.plot()

R data files to parquet

Convert R data files (.rds, .rda) to parquet files that load into Radiant-AI. Factors become Enums with R's level order, and the markdown description Radiant stores with a dataset is kept inside the parquet file and beside it as <name>_description.md. Requires R (Rscript).

rsm.data.rds_to_parquet("~/data/*.rds")                       # writes ~/data/<name>.parquet
rsm.data.rds_to_parquet("~/data", out_dir="~/parquet")         # every .rds/.rda in a folder
rsm.data.read_description("~/data/diamonds.parquet")

Or from a terminal: rds2parquet ~/data/*.rds (rds2parquet --help for options).

Examples

Extensive example notebooks are available at: https://github.com/radiant-ai-hub/pyrsm/tree/main/examples

License

This project is licensed under the GNU Affero General Public License v3.0.

Metadata

Release files for pyrsm 2.6.0

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

Source distribution (sdist)

Source distribution for pyrsm 2.6.0
File Size Uploaded Provenance Actions
pyrsm-2.6.0.tar.gz 797.1 kB Without provenance Details for pyrsm-2.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrsm 2.6.0
File Interpreter ABI Platform Actions
pyrsm-2.6.0-py3-none-any.whl Python 3 none any Details for pyrsm-2.6.0-py3-none-any.whl

Total release size: 1.5 MB

Release files / pyrsm-2.6.0.tar.gz

Download URL pyrsm-2.6.0.tar.gz
Size 797.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f6e8c11bfb75a37a28460215b5138bbc3e69e3aa252eeb608a09563754b911ac
BLAKE2b-256 checksum
How to use checksums
468fe4f46fbdf89a524ce1d01d401fc287e0bfb30bbca91c849596360df49970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / pyrsm-2.6.0-py3-none-any.whl

Download URL pyrsm-2.6.0-py3-none-any.whl
Size 655.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9772716a17ead63b83bea3dff7613be3ac534973e63d222788c24ea556c16311
BLAKE2b-256 checksum
How to use checksums
29ec44314c4a4503e43d39563b32c21f25657d1c42367ca4d1c2db1834a2fb59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for pyrsm 2.6.0

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.

Release history Release notifications | RSS feed

This release

2.6.0 This release

2 release files No provenance

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