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.1

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.1
File Size Uploaded Provenance Actions
pyrsm-2.6.1.tar.gz 814.6 kB Without provenance Details for pyrsm-2.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / pyrsm-2.6.1.tar.gz

Download URL pyrsm-2.6.1.tar.gz
Size 814.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3e600285d6c63441c4d9ea6d5c8456e9267cdea1c1fa4f4a944e9e6b9bea21a1
BLAKE2b-256 checksum
How to use checksums
87e94a3985569d093adb5d5894e6d4cefafc424c1d8cb97109f2bb8f827c9e5b
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.1-py3-none-any.whl

Download URL pyrsm-2.6.1-py3-none-any.whl
Size 658.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfa7283e71df81c30d1843550f6d62bec429508d20c379aef3277e11bca64648
BLAKE2b-256 checksum
How to use checksums
be6a8130cdd8823890f63c087e63b315eb2ecb00b334175cfec3c250cd8fbcf3
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.1

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.1 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