ruddy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ruddy-0.1.0/.gitignore +218 -0
- ruddy-0.1.0/LICENSE +21 -0
- ruddy-0.1.0/PKG-INFO +220 -0
- ruddy-0.1.0/README.md +182 -0
- ruddy-0.1.0/pyproject.toml +165 -0
- ruddy-0.1.0/ruddy/__init__.py +279 -0
- ruddy-0.1.0/ruddy/_version.py +3 -0
- ruddy-0.1.0/ruddy/analysis/__init__.py +15 -0
- ruddy-0.1.0/ruddy/analysis/api.py +51 -0
- ruddy-0.1.0/ruddy/analysis/config.py +936 -0
- ruddy-0.1.0/ruddy/analysis/engine.py +366 -0
- ruddy-0.1.0/ruddy/analysis/intervals.py +403 -0
- ruddy-0.1.0/ruddy/analysis/results.py +96 -0
- ruddy-0.1.0/ruddy/anomaly/__init__.py +5 -0
- ruddy-0.1.0/ruddy/anomaly/analysis.py +193 -0
- ruddy-0.1.0/ruddy/bayesian/__init__.py +5 -0
- ruddy-0.1.0/ruddy/bayesian/analysis.py +346 -0
- ruddy-0.1.0/ruddy/bivariate/__init__.py +52 -0
- ruddy-0.1.0/ruddy/bivariate/analysis.py +121 -0
- ruddy-0.1.0/ruddy/bivariate/associations.py +232 -0
- ruddy-0.1.0/ruddy/bivariate/comparisons.py +463 -0
- ruddy-0.1.0/ruddy/bivariate/contingency.py +193 -0
- ruddy-0.1.0/ruddy/bivariate/correlations.py +167 -0
- ruddy-0.1.0/ruddy/bivariate/dependence.py +514 -0
- ruddy-0.1.0/ruddy/bivariate/groups.py +739 -0
- ruddy-0.1.0/ruddy/bivariate/posthoc.py +363 -0
- ruddy-0.1.0/ruddy/cli/__init__.py +1 -0
- ruddy-0.1.0/ruddy/cli/_console.py +124 -0
- ruddy-0.1.0/ruddy/cli/_enums.py +108 -0
- ruddy-0.1.0/ruddy/cli/_options.py +363 -0
- ruddy-0.1.0/ruddy/cli/analyze.py +414 -0
- ruddy-0.1.0/ruddy/cli/commands/__init__.py +108 -0
- ruddy-0.1.0/ruddy/cli/commands/advanced_groups.py +231 -0
- ruddy-0.1.0/ruddy/cli/commands/analyze.py +146 -0
- ruddy-0.1.0/ruddy/cli/commands/bivariate.py +47 -0
- ruddy-0.1.0/ruddy/cli/commands/descriptive.py +311 -0
- ruddy-0.1.0/ruddy/cli/commands/factorial.py +112 -0
- ruddy-0.1.0/ruddy/cli/commands/groups.py +121 -0
- ruddy-0.1.0/ruddy/cli/commands/inference.py +160 -0
- ruddy-0.1.0/ruddy/cli/commands/multivariate.py +174 -0
- ruddy-0.1.0/ruddy/cli/commands/outliers.py +44 -0
- ruddy-0.1.0/ruddy/cli/commands/projections.py +187 -0
- ruddy-0.1.0/ruddy/cli/commands/specialized.py +221 -0
- ruddy-0.1.0/ruddy/cli/inspect.py +200 -0
- ruddy-0.1.0/ruddy/cli/main.py +88 -0
- ruddy-0.1.0/ruddy/cli/model.py +277 -0
- ruddy-0.1.0/ruddy/cli/pipeline.py +291 -0
- ruddy-0.1.0/ruddy/cli/project.py +93 -0
- ruddy-0.1.0/ruddy/compositional/__init__.py +25 -0
- ruddy-0.1.0/ruddy/compositional/analysis.py +246 -0
- ruddy-0.1.0/ruddy/core/__init__.py +61 -0
- ruddy-0.1.0/ruddy/core/enums.py +134 -0
- ruddy-0.1.0/ruddy/core/exceptions.py +55 -0
- ruddy-0.1.0/ruddy/core/frames.py +75 -0
- ruddy-0.1.0/ruddy/core/io.py +166 -0
- ruddy-0.1.0/ruddy/core/types.py +20 -0
- ruddy-0.1.0/ruddy/data/__init__.py +19 -0
- ruddy-0.1.0/ruddy/data/annotations.py +269 -0
- ruddy-0.1.0/ruddy/data/dataset.py +146 -0
- ruddy-0.1.0/ruddy/data/feature_matrix.py +185 -0
- ruddy-0.1.0/ruddy/data/roles.py +159 -0
- ruddy-0.1.0/ruddy/data/validation.py +187 -0
- ruddy-0.1.0/ruddy/factorial/__init__.py +23 -0
- ruddy-0.1.0/ruddy/factorial/design.py +351 -0
- ruddy-0.1.0/ruddy/factorial/diagnostics.py +370 -0
- ruddy-0.1.0/ruddy/factorial/effects.py +64 -0
- ruddy-0.1.0/ruddy/factorial/marginal_means.py +322 -0
- ruddy-0.1.0/ruddy/factorial/mixed_effects.py +388 -0
- ruddy-0.1.0/ruddy/factorial/models.py +717 -0
- ruddy-0.1.0/ruddy/multivariate/__init__.py +24 -0
- ruddy-0.1.0/ruddy/multivariate/analysis.py +105 -0
- ruddy-0.1.0/ruddy/multivariate/collinearity.py +214 -0
- ruddy-0.1.0/ruddy/multivariate/covariance.py +261 -0
- ruddy-0.1.0/ruddy/multivariate/distances.py +293 -0
- ruddy-0.1.0/ruddy/multivariate/manova.py +398 -0
- ruddy-0.1.0/ruddy/multivariate/permutation.py +441 -0
- ruddy-0.1.0/ruddy/profiling/__init__.py +37 -0
- ruddy-0.1.0/ruddy/profiling/columns.py +137 -0
- ruddy-0.1.0/ruddy/profiling/missingness.py +192 -0
- ruddy-0.1.0/ruddy/profiling/overview.py +171 -0
- ruddy-0.1.0/ruddy/projections/__init__.py +21 -0
- ruddy-0.1.0/ruddy/projections/manifold.py +243 -0
- ruddy-0.1.0/ruddy/projections/pca.py +197 -0
- ruddy-0.1.0/ruddy/projections/preprocessing.py +193 -0
- ruddy-0.1.0/ruddy/py.typed +0 -0
- ruddy-0.1.0/ruddy/representation/__init__.py +19 -0
- ruddy-0.1.0/ruddy/representation/analysis.py +556 -0
- ruddy-0.1.0/ruddy/results/__init__.py +18 -0
- ruddy-0.1.0/ruddy/results/base.py +116 -0
- ruddy-0.1.0/ruddy/results/provenance.py +41 -0
- ruddy-0.1.0/ruddy/results/schemas.py +52 -0
- ruddy-0.1.0/ruddy/statistics/__init__.py +50 -0
- ruddy-0.1.0/ruddy/statistics/assumptions.py +24 -0
- ruddy-0.1.0/ruddy/statistics/bootstrap.py +177 -0
- ruddy-0.1.0/ruddy/statistics/confidence_intervals.py +76 -0
- ruddy-0.1.0/ruddy/statistics/effect_sizes.py +83 -0
- ruddy-0.1.0/ruddy/statistics/multiple_testing.py +127 -0
- ruddy-0.1.0/ruddy/statistics/robust.py +70 -0
- ruddy-0.1.0/ruddy/univariate/__init__.py +65 -0
- ruddy-0.1.0/ruddy/univariate/categorical.py +189 -0
- ruddy-0.1.0/ruddy/univariate/diagnostics.py +294 -0
- ruddy-0.1.0/ruddy/univariate/distributions.py +189 -0
- ruddy-0.1.0/ruddy/univariate/numeric.py +234 -0
- ruddy-0.1.0/ruddy/univariate/outliers.py +637 -0
ruddy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
ruddy-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KrenAI Lab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ruddy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ruddy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Domain-agnostic statistical exploratory data analysis for tabular datasets and feature representations.
|
|
5
|
+
Project-URL: Homepage, https://github.com/kren-ai-lab/ruddy
|
|
6
|
+
Project-URL: Repository, https://github.com/kren-ai-lab/ruddy
|
|
7
|
+
Project-URL: Issues, https://github.com/kren-ai-lab/ruddy/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/kren-ai-lab/ruddy#readme
|
|
9
|
+
Author-email: Kren AI Lab <krenai@umag.cl>
|
|
10
|
+
Maintainer: David Medina-Ortiz, Diego Alvarez-Saravia
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: dimensionality-reduction,exploratory-data-analysis,factorial-analysis,multivariate-analysis,scientific-software,statistics,tabular-data
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: <3.15,>=3.11
|
|
26
|
+
Requires-Dist: numpy<3,>=1.26
|
|
27
|
+
Requires-Dist: pandas<4,>=3.0
|
|
28
|
+
Requires-Dist: polars<2,>=1.44
|
|
29
|
+
Requires-Dist: pyarrow>=18
|
|
30
|
+
Requires-Dist: rich>=13.9
|
|
31
|
+
Requires-Dist: scikit-learn<2,>=1.4
|
|
32
|
+
Requires-Dist: scipy<2,>=1.15
|
|
33
|
+
Requires-Dist: statsmodels<1,>=0.14.6
|
|
34
|
+
Requires-Dist: typer<1,>=0.27
|
|
35
|
+
Provides-Extra: manifold
|
|
36
|
+
Requires-Dist: umap-learn<1,>=0.5.7; extra == 'manifold'
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
38
|
+
|
|
39
|
+
# Ruddy
|
|
40
|
+
|
|
41
|
+
[](https://pypi.org/project/ruddy/)
|
|
42
|
+
[](https://github.com/kren-ai-lab/ruddy)
|
|
43
|
+
[](https://github.com/kren-ai-lab/ruddy/actions/workflows/tests.yml)
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
Ruddy is a Python library for statistical exploratory data analysis. It works
|
|
47
|
+
on tables and on numerical feature spaces such as embeddings or descriptor
|
|
48
|
+
matrices, as long as each row belongs to an identifiable observation. Results
|
|
49
|
+
come back as Polars tables that carry sample counts, diagnostics and the
|
|
50
|
+
parameters used, so you can filter them, export them or plot them.
|
|
51
|
+
|
|
52
|
+
Ruddy doesn't know about any particular domain and doesn't compute features. You
|
|
53
|
+
bring the data or the representation, and Ruddy analyzes it. It also has no
|
|
54
|
+
plotting code, but you can use your prefered library for visualizations.
|
|
55
|
+
See [example notebooks](https://github.com/kren-ai-lab/ruddy/blob/main/examples/README.md) for more comprehensive examples.
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
Ruddy supports Python 3.11 to 3.14.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
python -m pip install ruddy
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
For optional UMAP support:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python -m pip install "ruddy[manifold]"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
For development setup with `uv`, see [DEVELOPMENT.md](https://github.com/kren-ai-lab/ruddy/blob/main/DEVELOPMENT.md).
|
|
72
|
+
|
|
73
|
+
## Analyze a table
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import polars as pl
|
|
77
|
+
from ruddy import TabularDataset, analyze_univariate, analyze_bivariate
|
|
78
|
+
|
|
79
|
+
frame = pl.DataFrame({
|
|
80
|
+
"id": ["s1", "s2", "s3", "s4", "s5", "s6"],
|
|
81
|
+
"activity": [1.2, 2.4, 1.8, 3.1, 2.9, 4.2],
|
|
82
|
+
"length": [10.0, 14.0, 12.0, 17.0, 15.0, 20.0],
|
|
83
|
+
"family": ["A", "A", "A", "B", "B", "B"],
|
|
84
|
+
})
|
|
85
|
+
dataset = TabularDataset(
|
|
86
|
+
frame,
|
|
87
|
+
id_column="id",
|
|
88
|
+
role_overrides={
|
|
89
|
+
"activity": "response",
|
|
90
|
+
"family": "factor",
|
|
91
|
+
"length": "covariate",
|
|
92
|
+
},
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
univariate = analyze_univariate(dataset)
|
|
96
|
+
bivariate = analyze_bivariate(dataset)
|
|
97
|
+
print(univariate.numeric_statistics)
|
|
98
|
+
print(bivariate.correlations)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
To read files, use `pl.read_csv(...)` or `pl.read_parquet(...)`. pandas
|
|
102
|
+
DataFrames work too. A column's role doesn't depend on its dtype, so a batch
|
|
103
|
+
stored as integers can still be declared a categorical factor. The
|
|
104
|
+
[data contracts](https://github.com/kren-ai-lab/ruddy/blob/main/docs/DATA_CONTRACTS.md) guide explains how observation IDs
|
|
105
|
+
are checked and aligned.
|
|
106
|
+
|
|
107
|
+
## Analyze a feature space
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from ruddy import FeatureMatrix, analyze_pca
|
|
111
|
+
|
|
112
|
+
features = FeatureMatrix(
|
|
113
|
+
dataset.frame.select("activity", "length"),
|
|
114
|
+
observation_ids=dataset.observation_ids,
|
|
115
|
+
)
|
|
116
|
+
pca = analyze_pca(features, n_components=2, scaling="standard")
|
|
117
|
+
print(pca.scores)
|
|
118
|
+
print(pca.variance)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`FeatureMatrix` also takes NumPy arrays and SciPy sparse matrices. Not every
|
|
122
|
+
method accepts sparse input, and Ruddy raises an error rather than densify it
|
|
123
|
+
behind your back. To compare two feature spaces, give both of them observation
|
|
124
|
+
IDs:
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
# Given two FeatureMatrix objects named space_a and space_b:
|
|
128
|
+
from ruddy import analyze_representation_similarity
|
|
129
|
+
|
|
130
|
+
comparison = analyze_representation_similarity(
|
|
131
|
+
space_a,
|
|
132
|
+
space_b,
|
|
133
|
+
alignment="strict",
|
|
134
|
+
cca_components=2,
|
|
135
|
+
random_state=42,
|
|
136
|
+
)
|
|
137
|
+
print(comparison.cka)
|
|
138
|
+
print(comparison.mantel)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The [method reference](https://github.com/kren-ai-lab/ruddy/blob/main/docs/METHODS.md) lists every analysis with its
|
|
142
|
+
assumptions and how to read its output. Besides the ones above, Ruddy has group
|
|
143
|
+
comparisons, bootstrap intervals, factorial and mixed-effects models, PERMANOVA,
|
|
144
|
+
compositional data, Bayesian summaries and anomaly flags.
|
|
145
|
+
|
|
146
|
+
## Run several analyses
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from ruddy import AnalysisConfig, analyze
|
|
150
|
+
|
|
151
|
+
result = analyze(
|
|
152
|
+
dataset,
|
|
153
|
+
config=AnalysisConfig(
|
|
154
|
+
enabled_blocks=("profiling", "univariate", "groups", "outliers"),
|
|
155
|
+
responses=("activity",),
|
|
156
|
+
groups=("family",),
|
|
157
|
+
random_state=42,
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
print(result.summary())
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
By default only profiling and univariate analysis run. The
|
|
164
|
+
[unified analysis](https://github.com/kren-ai-lab/ruddy/blob/main/docs/UNIFIED_ANALYSIS.md) guide covers the other blocks and
|
|
165
|
+
their parameters.
|
|
166
|
+
|
|
167
|
+
## Command line
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
ruddy --help
|
|
171
|
+
ruddy analyze bivariate data.csv \
|
|
172
|
+
--id-column id \
|
|
173
|
+
--factor family \
|
|
174
|
+
--output-dir results
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The commands are grouped under `inspect`, `analyze`, `model` and `project`.
|
|
178
|
+
`ruddy pipeline` runs several blocks in one go, but only the ones you select.
|
|
179
|
+
The [CLI reference](https://github.com/kren-ai-lab/ruddy/blob/main/docs/CLI_REFERENCE.md) documents every option and the
|
|
180
|
+
files each command writes.
|
|
181
|
+
|
|
182
|
+
## Design principles
|
|
183
|
+
|
|
184
|
+
Ruddy tries hard not to make decisions for you:
|
|
185
|
+
|
|
186
|
+
- Scaling and dimensionality reduction happen only when you ask for them.
|
|
187
|
+
Missing values aren't imputed, and a string that looks like a number stays a
|
|
188
|
+
string.
|
|
189
|
+
- Each analysis reports which observations it used. Excluding a row never
|
|
190
|
+
deletes it from your data.
|
|
191
|
+
- A diagnostic never swaps the test you asked for. If a normality check fails,
|
|
192
|
+
you still get the test you requested, with the diagnostic next to it.
|
|
193
|
+
- A rank-deficient problem is reported as such, not quietly regularized.
|
|
194
|
+
- Outliers are flagged and left alone.
|
|
195
|
+
- Data and annotations are matched by observation ID, never by row position.
|
|
196
|
+
- Every result records its parameters, input sizes, random seed and the Ruddy
|
|
197
|
+
version that produced it.
|
|
198
|
+
|
|
199
|
+
Because of this, read `status` and `reason` next to every estimate. `ok` means
|
|
200
|
+
the quantity was estimated. `degenerate` means the data can't support it, for
|
|
201
|
+
example a constant column in a correlation. `skipped` means a requirement
|
|
202
|
+
wasn't met. Missing values in result tables are Polars nulls, not NaN. See
|
|
203
|
+
[results and provenance](https://github.com/kren-ai-lab/ruddy/blob/main/docs/RESULTS_AND_PROVENANCE.md) for how to read and
|
|
204
|
+
export results.
|
|
205
|
+
|
|
206
|
+
## Documentation and examples
|
|
207
|
+
|
|
208
|
+
The [documentation index](https://github.com/kren-ai-lab/ruddy/blob/main/docs/README.md) links all the guides. There are also
|
|
209
|
+
[13 example notebooks](https://github.com/kren-ai-lab/ruddy/blob/main/examples/README.md) written in marimo. To open one:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
uv sync --all-extras --group examples
|
|
213
|
+
uv run marimo edit examples/01_profiling_univariate.py
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Citing and license
|
|
217
|
+
|
|
218
|
+
If you use Ruddy in published work, please cite it using
|
|
219
|
+
[`CITATION.cff`](https://github.com/kren-ai-lab/ruddy/blob/main/CITATION.cff), or the "Cite this repository" button on
|
|
220
|
+
GitHub. Ruddy is released under the [MIT license](https://github.com/kren-ai-lab/ruddy/blob/main/LICENSE).
|
ruddy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Ruddy
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/ruddy/)
|
|
4
|
+
[](https://github.com/kren-ai-lab/ruddy)
|
|
5
|
+
[](https://github.com/kren-ai-lab/ruddy/actions/workflows/tests.yml)
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Ruddy is a Python library for statistical exploratory data analysis. It works
|
|
9
|
+
on tables and on numerical feature spaces such as embeddings or descriptor
|
|
10
|
+
matrices, as long as each row belongs to an identifiable observation. Results
|
|
11
|
+
come back as Polars tables that carry sample counts, diagnostics and the
|
|
12
|
+
parameters used, so you can filter them, export them or plot them.
|
|
13
|
+
|
|
14
|
+
Ruddy doesn't know about any particular domain and doesn't compute features. You
|
|
15
|
+
bring the data or the representation, and Ruddy analyzes it. It also has no
|
|
16
|
+
plotting code, but you can use your prefered library for visualizations.
|
|
17
|
+
See [example notebooks](https://github.com/kren-ai-lab/ruddy/blob/main/examples/README.md) for more comprehensive examples.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Ruddy supports Python 3.11 to 3.14.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python -m pip install ruddy
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For optional UMAP support:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m pip install "ruddy[manifold]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For development setup with `uv`, see [DEVELOPMENT.md](https://github.com/kren-ai-lab/ruddy/blob/main/DEVELOPMENT.md).
|
|
34
|
+
|
|
35
|
+
## Analyze a table
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import polars as pl
|
|
39
|
+
from ruddy import TabularDataset, analyze_univariate, analyze_bivariate
|
|
40
|
+
|
|
41
|
+
frame = pl.DataFrame({
|
|
42
|
+
"id": ["s1", "s2", "s3", "s4", "s5", "s6"],
|
|
43
|
+
"activity": [1.2, 2.4, 1.8, 3.1, 2.9, 4.2],
|
|
44
|
+
"length": [10.0, 14.0, 12.0, 17.0, 15.0, 20.0],
|
|
45
|
+
"family": ["A", "A", "A", "B", "B", "B"],
|
|
46
|
+
})
|
|
47
|
+
dataset = TabularDataset(
|
|
48
|
+
frame,
|
|
49
|
+
id_column="id",
|
|
50
|
+
role_overrides={
|
|
51
|
+
"activity": "response",
|
|
52
|
+
"family": "factor",
|
|
53
|
+
"length": "covariate",
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
univariate = analyze_univariate(dataset)
|
|
58
|
+
bivariate = analyze_bivariate(dataset)
|
|
59
|
+
print(univariate.numeric_statistics)
|
|
60
|
+
print(bivariate.correlations)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
To read files, use `pl.read_csv(...)` or `pl.read_parquet(...)`. pandas
|
|
64
|
+
DataFrames work too. A column's role doesn't depend on its dtype, so a batch
|
|
65
|
+
stored as integers can still be declared a categorical factor. The
|
|
66
|
+
[data contracts](https://github.com/kren-ai-lab/ruddy/blob/main/docs/DATA_CONTRACTS.md) guide explains how observation IDs
|
|
67
|
+
are checked and aligned.
|
|
68
|
+
|
|
69
|
+
## Analyze a feature space
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from ruddy import FeatureMatrix, analyze_pca
|
|
73
|
+
|
|
74
|
+
features = FeatureMatrix(
|
|
75
|
+
dataset.frame.select("activity", "length"),
|
|
76
|
+
observation_ids=dataset.observation_ids,
|
|
77
|
+
)
|
|
78
|
+
pca = analyze_pca(features, n_components=2, scaling="standard")
|
|
79
|
+
print(pca.scores)
|
|
80
|
+
print(pca.variance)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`FeatureMatrix` also takes NumPy arrays and SciPy sparse matrices. Not every
|
|
84
|
+
method accepts sparse input, and Ruddy raises an error rather than densify it
|
|
85
|
+
behind your back. To compare two feature spaces, give both of them observation
|
|
86
|
+
IDs:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# Given two FeatureMatrix objects named space_a and space_b:
|
|
90
|
+
from ruddy import analyze_representation_similarity
|
|
91
|
+
|
|
92
|
+
comparison = analyze_representation_similarity(
|
|
93
|
+
space_a,
|
|
94
|
+
space_b,
|
|
95
|
+
alignment="strict",
|
|
96
|
+
cca_components=2,
|
|
97
|
+
random_state=42,
|
|
98
|
+
)
|
|
99
|
+
print(comparison.cka)
|
|
100
|
+
print(comparison.mantel)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The [method reference](https://github.com/kren-ai-lab/ruddy/blob/main/docs/METHODS.md) lists every analysis with its
|
|
104
|
+
assumptions and how to read its output. Besides the ones above, Ruddy has group
|
|
105
|
+
comparisons, bootstrap intervals, factorial and mixed-effects models, PERMANOVA,
|
|
106
|
+
compositional data, Bayesian summaries and anomaly flags.
|
|
107
|
+
|
|
108
|
+
## Run several analyses
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from ruddy import AnalysisConfig, analyze
|
|
112
|
+
|
|
113
|
+
result = analyze(
|
|
114
|
+
dataset,
|
|
115
|
+
config=AnalysisConfig(
|
|
116
|
+
enabled_blocks=("profiling", "univariate", "groups", "outliers"),
|
|
117
|
+
responses=("activity",),
|
|
118
|
+
groups=("family",),
|
|
119
|
+
random_state=42,
|
|
120
|
+
),
|
|
121
|
+
)
|
|
122
|
+
print(result.summary())
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
By default only profiling and univariate analysis run. The
|
|
126
|
+
[unified analysis](https://github.com/kren-ai-lab/ruddy/blob/main/docs/UNIFIED_ANALYSIS.md) guide covers the other blocks and
|
|
127
|
+
their parameters.
|
|
128
|
+
|
|
129
|
+
## Command line
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
ruddy --help
|
|
133
|
+
ruddy analyze bivariate data.csv \
|
|
134
|
+
--id-column id \
|
|
135
|
+
--factor family \
|
|
136
|
+
--output-dir results
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The commands are grouped under `inspect`, `analyze`, `model` and `project`.
|
|
140
|
+
`ruddy pipeline` runs several blocks in one go, but only the ones you select.
|
|
141
|
+
The [CLI reference](https://github.com/kren-ai-lab/ruddy/blob/main/docs/CLI_REFERENCE.md) documents every option and the
|
|
142
|
+
files each command writes.
|
|
143
|
+
|
|
144
|
+
## Design principles
|
|
145
|
+
|
|
146
|
+
Ruddy tries hard not to make decisions for you:
|
|
147
|
+
|
|
148
|
+
- Scaling and dimensionality reduction happen only when you ask for them.
|
|
149
|
+
Missing values aren't imputed, and a string that looks like a number stays a
|
|
150
|
+
string.
|
|
151
|
+
- Each analysis reports which observations it used. Excluding a row never
|
|
152
|
+
deletes it from your data.
|
|
153
|
+
- A diagnostic never swaps the test you asked for. If a normality check fails,
|
|
154
|
+
you still get the test you requested, with the diagnostic next to it.
|
|
155
|
+
- A rank-deficient problem is reported as such, not quietly regularized.
|
|
156
|
+
- Outliers are flagged and left alone.
|
|
157
|
+
- Data and annotations are matched by observation ID, never by row position.
|
|
158
|
+
- Every result records its parameters, input sizes, random seed and the Ruddy
|
|
159
|
+
version that produced it.
|
|
160
|
+
|
|
161
|
+
Because of this, read `status` and `reason` next to every estimate. `ok` means
|
|
162
|
+
the quantity was estimated. `degenerate` means the data can't support it, for
|
|
163
|
+
example a constant column in a correlation. `skipped` means a requirement
|
|
164
|
+
wasn't met. Missing values in result tables are Polars nulls, not NaN. See
|
|
165
|
+
[results and provenance](https://github.com/kren-ai-lab/ruddy/blob/main/docs/RESULTS_AND_PROVENANCE.md) for how to read and
|
|
166
|
+
export results.
|
|
167
|
+
|
|
168
|
+
## Documentation and examples
|
|
169
|
+
|
|
170
|
+
The [documentation index](https://github.com/kren-ai-lab/ruddy/blob/main/docs/README.md) links all the guides. There are also
|
|
171
|
+
[13 example notebooks](https://github.com/kren-ai-lab/ruddy/blob/main/examples/README.md) written in marimo. To open one:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
uv sync --all-extras --group examples
|
|
175
|
+
uv run marimo edit examples/01_profiling_univariate.py
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Citing and license
|
|
179
|
+
|
|
180
|
+
If you use Ruddy in published work, please cite it using
|
|
181
|
+
[`CITATION.cff`](https://github.com/kren-ai-lab/ruddy/blob/main/CITATION.cff), or the "Cite this repository" button on
|
|
182
|
+
GitHub. Ruddy is released under the [MIT license](https://github.com/kren-ai-lab/ruddy/blob/main/LICENSE).
|