ruddy 0.1.0__py3-none-any.whl
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/__init__.py +279 -0
- ruddy/_version.py +3 -0
- ruddy/analysis/__init__.py +15 -0
- ruddy/analysis/api.py +51 -0
- ruddy/analysis/config.py +936 -0
- ruddy/analysis/engine.py +366 -0
- ruddy/analysis/intervals.py +403 -0
- ruddy/analysis/results.py +96 -0
- ruddy/anomaly/__init__.py +5 -0
- ruddy/anomaly/analysis.py +193 -0
- ruddy/bayesian/__init__.py +5 -0
- ruddy/bayesian/analysis.py +346 -0
- ruddy/bivariate/__init__.py +52 -0
- ruddy/bivariate/analysis.py +121 -0
- ruddy/bivariate/associations.py +232 -0
- ruddy/bivariate/comparisons.py +463 -0
- ruddy/bivariate/contingency.py +193 -0
- ruddy/bivariate/correlations.py +167 -0
- ruddy/bivariate/dependence.py +514 -0
- ruddy/bivariate/groups.py +739 -0
- ruddy/bivariate/posthoc.py +363 -0
- ruddy/cli/__init__.py +1 -0
- ruddy/cli/_console.py +124 -0
- ruddy/cli/_enums.py +108 -0
- ruddy/cli/_options.py +363 -0
- ruddy/cli/analyze.py +414 -0
- ruddy/cli/commands/__init__.py +108 -0
- ruddy/cli/commands/advanced_groups.py +231 -0
- ruddy/cli/commands/analyze.py +146 -0
- ruddy/cli/commands/bivariate.py +47 -0
- ruddy/cli/commands/descriptive.py +311 -0
- ruddy/cli/commands/factorial.py +112 -0
- ruddy/cli/commands/groups.py +121 -0
- ruddy/cli/commands/inference.py +160 -0
- ruddy/cli/commands/multivariate.py +174 -0
- ruddy/cli/commands/outliers.py +44 -0
- ruddy/cli/commands/projections.py +187 -0
- ruddy/cli/commands/specialized.py +221 -0
- ruddy/cli/inspect.py +200 -0
- ruddy/cli/main.py +88 -0
- ruddy/cli/model.py +277 -0
- ruddy/cli/pipeline.py +291 -0
- ruddy/cli/project.py +93 -0
- ruddy/compositional/__init__.py +25 -0
- ruddy/compositional/analysis.py +246 -0
- ruddy/core/__init__.py +61 -0
- ruddy/core/enums.py +134 -0
- ruddy/core/exceptions.py +55 -0
- ruddy/core/frames.py +75 -0
- ruddy/core/io.py +166 -0
- ruddy/core/types.py +20 -0
- ruddy/data/__init__.py +19 -0
- ruddy/data/annotations.py +269 -0
- ruddy/data/dataset.py +146 -0
- ruddy/data/feature_matrix.py +185 -0
- ruddy/data/roles.py +159 -0
- ruddy/data/validation.py +187 -0
- ruddy/factorial/__init__.py +23 -0
- ruddy/factorial/design.py +351 -0
- ruddy/factorial/diagnostics.py +370 -0
- ruddy/factorial/effects.py +64 -0
- ruddy/factorial/marginal_means.py +322 -0
- ruddy/factorial/mixed_effects.py +388 -0
- ruddy/factorial/models.py +717 -0
- ruddy/multivariate/__init__.py +24 -0
- ruddy/multivariate/analysis.py +105 -0
- ruddy/multivariate/collinearity.py +214 -0
- ruddy/multivariate/covariance.py +261 -0
- ruddy/multivariate/distances.py +293 -0
- ruddy/multivariate/manova.py +398 -0
- ruddy/multivariate/permutation.py +441 -0
- ruddy/profiling/__init__.py +37 -0
- ruddy/profiling/columns.py +137 -0
- ruddy/profiling/missingness.py +192 -0
- ruddy/profiling/overview.py +171 -0
- ruddy/projections/__init__.py +21 -0
- ruddy/projections/manifold.py +243 -0
- ruddy/projections/pca.py +197 -0
- ruddy/projections/preprocessing.py +193 -0
- ruddy/py.typed +0 -0
- ruddy/representation/__init__.py +19 -0
- ruddy/representation/analysis.py +556 -0
- ruddy/results/__init__.py +18 -0
- ruddy/results/base.py +116 -0
- ruddy/results/provenance.py +41 -0
- ruddy/results/schemas.py +52 -0
- ruddy/statistics/__init__.py +50 -0
- ruddy/statistics/assumptions.py +24 -0
- ruddy/statistics/bootstrap.py +177 -0
- ruddy/statistics/confidence_intervals.py +76 -0
- ruddy/statistics/effect_sizes.py +83 -0
- ruddy/statistics/multiple_testing.py +127 -0
- ruddy/statistics/robust.py +70 -0
- ruddy/univariate/__init__.py +65 -0
- ruddy/univariate/categorical.py +189 -0
- ruddy/univariate/diagnostics.py +294 -0
- ruddy/univariate/distributions.py +189 -0
- ruddy/univariate/numeric.py +234 -0
- ruddy/univariate/outliers.py +637 -0
- ruddy-0.1.0.dist-info/METADATA +220 -0
- ruddy-0.1.0.dist-info/RECORD +104 -0
- ruddy-0.1.0.dist-info/WHEEL +4 -0
- ruddy-0.1.0.dist-info/entry_points.txt +2 -0
- ruddy-0.1.0.dist-info/licenses/LICENSE +21 -0
ruddy/__init__.py
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"""Ruddy: domain-agnostic statistical exploratory data analysis."""
|
|
2
|
+
|
|
3
|
+
from ruddy._version import __version__
|
|
4
|
+
from ruddy.analysis import (
|
|
5
|
+
AnalysisConfig,
|
|
6
|
+
ConfidenceIntervalResult,
|
|
7
|
+
UnifiedAnalysisResult,
|
|
8
|
+
analyze,
|
|
9
|
+
analyze_confidence_intervals,
|
|
10
|
+
analyze_groups,
|
|
11
|
+
)
|
|
12
|
+
from ruddy.anomaly import AnomalyResult, analyze_anomalies
|
|
13
|
+
from ruddy.bayesian import BayesianEDAResult, analyze_bayesian_eda
|
|
14
|
+
from ruddy.bivariate import (
|
|
15
|
+
BivariateResult,
|
|
16
|
+
ContingencyDiagnosticsResult,
|
|
17
|
+
DependenceResult,
|
|
18
|
+
GroupAnalysisResult,
|
|
19
|
+
PosthocResult,
|
|
20
|
+
analyze_bivariate,
|
|
21
|
+
analyze_contingency_diagnostics,
|
|
22
|
+
analyze_dependence,
|
|
23
|
+
analyze_grouped_responses,
|
|
24
|
+
analyze_posthoc,
|
|
25
|
+
distance_correlation,
|
|
26
|
+
resolve_groups,
|
|
27
|
+
resolve_responses,
|
|
28
|
+
summarize_annotation_coverage,
|
|
29
|
+
summarize_categorical_associations,
|
|
30
|
+
summarize_correlations,
|
|
31
|
+
summarize_general_dependence,
|
|
32
|
+
summarize_group_coverage,
|
|
33
|
+
summarize_grouped_categorical_responses,
|
|
34
|
+
summarize_grouped_numeric_responses,
|
|
35
|
+
summarize_numeric_categorical_comparisons,
|
|
36
|
+
summarize_partial_correlations,
|
|
37
|
+
summarize_response_catalog,
|
|
38
|
+
)
|
|
39
|
+
from ruddy.compositional import (
|
|
40
|
+
CompositionalResult,
|
|
41
|
+
aitchison_distance_matrix,
|
|
42
|
+
alr_transform,
|
|
43
|
+
analyze_composition,
|
|
44
|
+
closure,
|
|
45
|
+
clr_transform,
|
|
46
|
+
ilr_transform,
|
|
47
|
+
multiplicative_zero_replacement,
|
|
48
|
+
variation_matrix,
|
|
49
|
+
)
|
|
50
|
+
from ruddy.core import (
|
|
51
|
+
AlignmentMode,
|
|
52
|
+
AnalysisBlock,
|
|
53
|
+
AnnotationCoverage,
|
|
54
|
+
ColumnKind,
|
|
55
|
+
ColumnRole,
|
|
56
|
+
ComparisonTest,
|
|
57
|
+
CorrelationMethod,
|
|
58
|
+
OptionalDependencyError,
|
|
59
|
+
OutlierMethod,
|
|
60
|
+
PAdjustMethod,
|
|
61
|
+
ProjectionMethod,
|
|
62
|
+
ResultStatus,
|
|
63
|
+
ScalingMethod,
|
|
64
|
+
)
|
|
65
|
+
from ruddy.data import (
|
|
66
|
+
AlignedAnnotations,
|
|
67
|
+
FeatureMatrix,
|
|
68
|
+
TabularDataset,
|
|
69
|
+
align_annotation_source,
|
|
70
|
+
attach_annotations,
|
|
71
|
+
)
|
|
72
|
+
from ruddy.factorial import (
|
|
73
|
+
FactorialDesign,
|
|
74
|
+
FactorialResult,
|
|
75
|
+
FactorialTerm,
|
|
76
|
+
MarginalMeansResult,
|
|
77
|
+
MixedEffectsResult,
|
|
78
|
+
analyze_factorial,
|
|
79
|
+
analyze_marginal_means,
|
|
80
|
+
analyze_mixed_effects,
|
|
81
|
+
build_factorial_design,
|
|
82
|
+
)
|
|
83
|
+
from ruddy.multivariate import (
|
|
84
|
+
CollinearityResult,
|
|
85
|
+
CovarianceResult,
|
|
86
|
+
MahalanobisResult,
|
|
87
|
+
MANOVAResult,
|
|
88
|
+
MultivariateResult,
|
|
89
|
+
PermutationGroupResult,
|
|
90
|
+
analyze_collinearity,
|
|
91
|
+
analyze_covariance_structure,
|
|
92
|
+
analyze_mahalanobis,
|
|
93
|
+
analyze_manova,
|
|
94
|
+
analyze_multivariate,
|
|
95
|
+
analyze_permutation_group_structure,
|
|
96
|
+
)
|
|
97
|
+
from ruddy.profiling import (
|
|
98
|
+
ProfilingResult,
|
|
99
|
+
pairwise_completeness,
|
|
100
|
+
profile_columns,
|
|
101
|
+
profile_dataset,
|
|
102
|
+
summarize_missingness,
|
|
103
|
+
summarize_missingness_patterns,
|
|
104
|
+
summarize_overview,
|
|
105
|
+
)
|
|
106
|
+
from ruddy.projections import (
|
|
107
|
+
PCAResult,
|
|
108
|
+
PreparedFeatures,
|
|
109
|
+
ProjectionResult,
|
|
110
|
+
analyze_pca,
|
|
111
|
+
analyze_projection,
|
|
112
|
+
analyze_tsne,
|
|
113
|
+
analyze_umap,
|
|
114
|
+
prepare_features,
|
|
115
|
+
)
|
|
116
|
+
from ruddy.representation import (
|
|
117
|
+
AlignedRepresentationPair,
|
|
118
|
+
CCAResult,
|
|
119
|
+
RepresentationComparisonResult,
|
|
120
|
+
align_feature_matrices,
|
|
121
|
+
analyze_representation_similarity,
|
|
122
|
+
linear_cka,
|
|
123
|
+
)
|
|
124
|
+
from ruddy.results import Advisory, AnalysisProvenance, AnalysisResult
|
|
125
|
+
from ruddy.statistics import (
|
|
126
|
+
BootstrapResult,
|
|
127
|
+
bootstrap_confidence_interval,
|
|
128
|
+
mean_confidence_interval,
|
|
129
|
+
odds_ratio_confidence_interval,
|
|
130
|
+
pearson_confidence_interval,
|
|
131
|
+
welch_mean_difference_confidence_interval,
|
|
132
|
+
)
|
|
133
|
+
from ruddy.univariate import (
|
|
134
|
+
DistributionDiagnosticsResult,
|
|
135
|
+
OutlierResult,
|
|
136
|
+
UnivariateResult,
|
|
137
|
+
UnivariateTables,
|
|
138
|
+
analyze_distribution_diagnostics,
|
|
139
|
+
analyze_outliers,
|
|
140
|
+
analyze_univariate,
|
|
141
|
+
summarize_categorical_statistics,
|
|
142
|
+
summarize_datetime_statistics,
|
|
143
|
+
summarize_dispersion_diagnostics,
|
|
144
|
+
summarize_normality_diagnostics,
|
|
145
|
+
summarize_numeric_quality,
|
|
146
|
+
summarize_numeric_statistics,
|
|
147
|
+
summarize_outliers,
|
|
148
|
+
summarize_univariate,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
__all__ = [
|
|
152
|
+
"Advisory",
|
|
153
|
+
"AlignedAnnotations",
|
|
154
|
+
"AlignedRepresentationPair",
|
|
155
|
+
"AlignmentMode",
|
|
156
|
+
"AnalysisBlock",
|
|
157
|
+
"AnalysisConfig",
|
|
158
|
+
"AnalysisProvenance",
|
|
159
|
+
"AnalysisResult",
|
|
160
|
+
"AnnotationCoverage",
|
|
161
|
+
"AnomalyResult",
|
|
162
|
+
"BayesianEDAResult",
|
|
163
|
+
"BivariateResult",
|
|
164
|
+
"BootstrapResult",
|
|
165
|
+
"CCAResult",
|
|
166
|
+
"CollinearityResult",
|
|
167
|
+
"ColumnKind",
|
|
168
|
+
"ColumnRole",
|
|
169
|
+
"ComparisonTest",
|
|
170
|
+
"CompositionalResult",
|
|
171
|
+
"ConfidenceIntervalResult",
|
|
172
|
+
"ContingencyDiagnosticsResult",
|
|
173
|
+
"CorrelationMethod",
|
|
174
|
+
"CovarianceResult",
|
|
175
|
+
"DependenceResult",
|
|
176
|
+
"DistributionDiagnosticsResult",
|
|
177
|
+
"FactorialDesign",
|
|
178
|
+
"FactorialResult",
|
|
179
|
+
"FactorialTerm",
|
|
180
|
+
"FeatureMatrix",
|
|
181
|
+
"GroupAnalysisResult",
|
|
182
|
+
"MANOVAResult",
|
|
183
|
+
"MahalanobisResult",
|
|
184
|
+
"MarginalMeansResult",
|
|
185
|
+
"MixedEffectsResult",
|
|
186
|
+
"MultivariateResult",
|
|
187
|
+
"OptionalDependencyError",
|
|
188
|
+
"OutlierMethod",
|
|
189
|
+
"OutlierResult",
|
|
190
|
+
"PAdjustMethod",
|
|
191
|
+
"PCAResult",
|
|
192
|
+
"PermutationGroupResult",
|
|
193
|
+
"PosthocResult",
|
|
194
|
+
"PreparedFeatures",
|
|
195
|
+
"ProfilingResult",
|
|
196
|
+
"ProjectionMethod",
|
|
197
|
+
"ProjectionResult",
|
|
198
|
+
"RepresentationComparisonResult",
|
|
199
|
+
"ResultStatus",
|
|
200
|
+
"ScalingMethod",
|
|
201
|
+
"TabularDataset",
|
|
202
|
+
"UnifiedAnalysisResult",
|
|
203
|
+
"UnivariateResult",
|
|
204
|
+
"UnivariateTables",
|
|
205
|
+
"__version__",
|
|
206
|
+
"aitchison_distance_matrix",
|
|
207
|
+
"align_annotation_source",
|
|
208
|
+
"align_feature_matrices",
|
|
209
|
+
"alr_transform",
|
|
210
|
+
"analyze",
|
|
211
|
+
"analyze_anomalies",
|
|
212
|
+
"analyze_bayesian_eda",
|
|
213
|
+
"analyze_bivariate",
|
|
214
|
+
"analyze_collinearity",
|
|
215
|
+
"analyze_composition",
|
|
216
|
+
"analyze_confidence_intervals",
|
|
217
|
+
"analyze_contingency_diagnostics",
|
|
218
|
+
"analyze_covariance_structure",
|
|
219
|
+
"analyze_dependence",
|
|
220
|
+
"analyze_distribution_diagnostics",
|
|
221
|
+
"analyze_factorial",
|
|
222
|
+
"analyze_grouped_responses",
|
|
223
|
+
"analyze_groups",
|
|
224
|
+
"analyze_mahalanobis",
|
|
225
|
+
"analyze_manova",
|
|
226
|
+
"analyze_marginal_means",
|
|
227
|
+
"analyze_mixed_effects",
|
|
228
|
+
"analyze_multivariate",
|
|
229
|
+
"analyze_outliers",
|
|
230
|
+
"analyze_pca",
|
|
231
|
+
"analyze_permutation_group_structure",
|
|
232
|
+
"analyze_posthoc",
|
|
233
|
+
"analyze_projection",
|
|
234
|
+
"analyze_representation_similarity",
|
|
235
|
+
"analyze_tsne",
|
|
236
|
+
"analyze_umap",
|
|
237
|
+
"analyze_univariate",
|
|
238
|
+
"attach_annotations",
|
|
239
|
+
"bootstrap_confidence_interval",
|
|
240
|
+
"build_factorial_design",
|
|
241
|
+
"closure",
|
|
242
|
+
"clr_transform",
|
|
243
|
+
"distance_correlation",
|
|
244
|
+
"ilr_transform",
|
|
245
|
+
"linear_cka",
|
|
246
|
+
"mean_confidence_interval",
|
|
247
|
+
"multiplicative_zero_replacement",
|
|
248
|
+
"odds_ratio_confidence_interval",
|
|
249
|
+
"pairwise_completeness",
|
|
250
|
+
"pearson_confidence_interval",
|
|
251
|
+
"prepare_features",
|
|
252
|
+
"profile_columns",
|
|
253
|
+
"profile_dataset",
|
|
254
|
+
"resolve_groups",
|
|
255
|
+
"resolve_responses",
|
|
256
|
+
"summarize_annotation_coverage",
|
|
257
|
+
"summarize_categorical_associations",
|
|
258
|
+
"summarize_categorical_statistics",
|
|
259
|
+
"summarize_correlations",
|
|
260
|
+
"summarize_datetime_statistics",
|
|
261
|
+
"summarize_dispersion_diagnostics",
|
|
262
|
+
"summarize_general_dependence",
|
|
263
|
+
"summarize_group_coverage",
|
|
264
|
+
"summarize_grouped_categorical_responses",
|
|
265
|
+
"summarize_grouped_numeric_responses",
|
|
266
|
+
"summarize_missingness",
|
|
267
|
+
"summarize_missingness_patterns",
|
|
268
|
+
"summarize_normality_diagnostics",
|
|
269
|
+
"summarize_numeric_categorical_comparisons",
|
|
270
|
+
"summarize_numeric_quality",
|
|
271
|
+
"summarize_numeric_statistics",
|
|
272
|
+
"summarize_outliers",
|
|
273
|
+
"summarize_overview",
|
|
274
|
+
"summarize_partial_correlations",
|
|
275
|
+
"summarize_response_catalog",
|
|
276
|
+
"summarize_univariate",
|
|
277
|
+
"variation_matrix",
|
|
278
|
+
"welch_mean_difference_confidence_interval",
|
|
279
|
+
]
|
ruddy/_version.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""High-level analysis configuration and orchestration."""
|
|
2
|
+
|
|
3
|
+
from ruddy.analysis.api import analyze, analyze_groups
|
|
4
|
+
from ruddy.analysis.config import AnalysisConfig
|
|
5
|
+
from ruddy.analysis.intervals import ConfidenceIntervalResult, analyze_confidence_intervals
|
|
6
|
+
from ruddy.analysis.results import UnifiedAnalysisResult
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"AnalysisConfig",
|
|
10
|
+
"ConfidenceIntervalResult",
|
|
11
|
+
"UnifiedAnalysisResult",
|
|
12
|
+
"analyze",
|
|
13
|
+
"analyze_confidence_intervals",
|
|
14
|
+
"analyze_groups",
|
|
15
|
+
]
|
ruddy/analysis/api.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Public high-level analysis API."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from ruddy.analysis.engine import analyze
|
|
8
|
+
from ruddy.bivariate.groups import GroupAnalysisResult, analyze_grouped_responses
|
|
9
|
+
from ruddy.core.enums import ComparisonTest, PAdjustMethod
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from collections.abc import Iterable
|
|
13
|
+
|
|
14
|
+
from ruddy.data import AlignedAnnotations, TabularDataset
|
|
15
|
+
|
|
16
|
+
__all__ = ["analyze", "analyze_groups"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def analyze_groups(
|
|
20
|
+
dataset: TabularDataset,
|
|
21
|
+
*,
|
|
22
|
+
responses: Iterable[str] | None = None,
|
|
23
|
+
groups: Iterable[str] | None = None,
|
|
24
|
+
annotations: Iterable[AlignedAnnotations] = (),
|
|
25
|
+
comparison_tests: tuple[ComparisonTest | str, ...] = (
|
|
26
|
+
ComparisonTest.WELCH_T,
|
|
27
|
+
ComparisonTest.MANN_WHITNEY,
|
|
28
|
+
ComparisonTest.WELCH_ANOVA,
|
|
29
|
+
ComparisonTest.KRUSKAL_WALLIS,
|
|
30
|
+
ComparisonTest.CHI_SQUARE,
|
|
31
|
+
ComparisonTest.FISHER_EXACT,
|
|
32
|
+
),
|
|
33
|
+
p_adjust: PAdjustMethod | str = PAdjustMethod.FDR_BH,
|
|
34
|
+
min_group_n: int = 3,
|
|
35
|
+
max_group_levels: int = 20,
|
|
36
|
+
max_category_levels: int = 50,
|
|
37
|
+
pairwise: bool = False,
|
|
38
|
+
) -> GroupAnalysisResult:
|
|
39
|
+
"""Run response-centric grouped EDA using statistical roles and data kinds."""
|
|
40
|
+
return analyze_grouped_responses(
|
|
41
|
+
dataset,
|
|
42
|
+
responses=responses,
|
|
43
|
+
groups=groups,
|
|
44
|
+
annotations=annotations,
|
|
45
|
+
comparison_tests=comparison_tests,
|
|
46
|
+
p_adjust=p_adjust,
|
|
47
|
+
min_group_n=min_group_n,
|
|
48
|
+
max_group_levels=max_group_levels,
|
|
49
|
+
max_category_levels=max_category_levels,
|
|
50
|
+
pairwise=pairwise,
|
|
51
|
+
)
|