Metadata-Version: 2.4
Name: pyrsm
Version: 2.4.1
Summary: Python package used in the MSBA program the Rady School of Management @ UCSD
Author-email: Vincent Nijs <vnijs@ucsd.edu>, Vikram Jambulapati <vikjam@ucsd.edu>, Suhas Goutham <sgoutham@ucsd.edu>, Raghav Prasad <rprasad@ucsd.edu>
License-Expression: AGPL-3.0-only
Project-URL: Bug Reports, https://github.com/radiant-ai-hub/pyrsm/issues
Project-URL: Source, https://github.com/vnijs/pyrsm
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0.2
Requires-Dist: pandas>=2.2.2
Requires-Dist: polars==1.36.1
Requires-Dist: matplotlib>=3.1.1
Requires-Dist: plotnine>=0.15.1
Requires-Dist: statsmodels>=0.14.4
Requires-Dist: scipy>=1.16.3
Requires-Dist: scikit-learn>=1.6.1
Requires-Dist: IPython>=7.34.0
Requires-Dist: pyarrow>=17.0.0
Requires-Dist: scikit-misc>=0.5.2
Requires-Dist: fastexcel>=0.18.0
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: nbformat>=5.10.4
Requires-Dist: nbclient>=0.10.2
Requires-Dist: ipykernel>=6.29.5
Requires-Dist: pip>=25.3
Provides-Extra: ml
Requires-Dist: xgboost>=2.1.1; extra == "ml"
Requires-Dist: scikit-misc>=0.5.1; extra == "ml"
Requires-Dist: xlogit; extra == "ml"
Provides-Extra: plot
Requires-Dist: plotly>=6.5.0; extra == "plot"
Requires-Dist: pillow>=11.2.1; extra == "plot"
Provides-Extra: tables
Requires-Dist: great-tables>=0.20.0; extra == "tables"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: pytest>=8.4.2; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: ipykernel>=6.17.1; extra == "dev"
Requires-Dist: jupyter>=1.0.0; extra == "dev"
Requires-Dist: nbconvert>=7.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Provides-Extra: notebooks
Requires-Dist: ipykernel>=6.17.1; extra == "notebooks"
Requires-Dist: jupyter>=1.0.0; extra == "notebooks"
Requires-Dist: nbconvert>=7.0.0; extra == "notebooks"
Provides-Extra: all
Requires-Dist: pyrsm[ml,plot,tables]; extra == "all"
Provides-Extra: full
Requires-Dist: pyrsm[all,dev]; extra == "full"
Dynamic: license-file

# 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](https://pola.rs/) DataFrames and [plotnine](https://plotnine.org/) for visualization.

## Installation

Requires Python 3.12+ and UV:

```bash
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:

```bash
uv add "pyrsm[ml]"
```

For all features:

```bash
uv add "pyrsm[all]"
```

## Quick Start

```python
import polars as pl
from pyrsm import basics, model

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

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

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

## 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](LICENSE).
