You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
-
# PyNNS
1
+
# NNS Python
2
2
3
3
Python port of the R NNS 12.1 beta package.
4
4
5
-
- PyPI package: `nns-pm`
6
-
- Import name: `pynns`
5
+
- Distribution package: `NNS`
6
+
- Import package: `nns` (`import nns`)
7
+
- Native extension: `nns._nnscore`
7
8
- Runtime dependencies: NumPy, SciPy
8
9
- R required for normal use: no
9
10
- Status: alpha, parity-focused
@@ -12,14 +13,14 @@ Python port of the R NNS 12.1 beta package.
12
13
## Install
13
14
14
15
```bash
15
-
pip install nns-pm
16
+
pip install NNS
16
17
```
17
18
18
19
## Quick Use
19
20
20
21
```python
21
22
import numpy as np
22
-
frompynnsimport lpm, nns_dep, nns_reg
23
+
fromnnsimport lpm, nns_dep, nns_reg
23
24
24
25
x = np.array([-2.0, -1.0, 0.5, 3.0])
25
26
downside = lpm(2, 0.0, x)
@@ -47,7 +48,7 @@ uv run ruff check .
47
48
uv run mypy
48
49
```
49
50
50
-
R and the R `NNS` package are only needed to regenerate parity fixtures.
51
+
CI parity is cache-backed through committed fixtures and does not require `Rscript`. `Rscript` and the R `NNS` package are only needed for local cache regeneration. The parity claim is bounded by committed fixtures and cache entries; full R package parity is not claimed, and plot artifacts are intentionally out of scope.
Copy file name to clipboardExpand all lines: docs/api_status.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
-
# PyNNS API Status
1
+
# NNS Python API Status
2
2
3
-
This page summarizes the public PyNNS API surface, known gaps, guarded paths,
3
+
This page summarizes the public NNS Python API surface, known gaps, guarded paths,
4
4
and design boundaries.
5
5
6
-
PyNNS is an alpha, parity-focused Python port of installed R NNS 12.1 beta,
6
+
NNS Python is an alpha, parity-focused Python port of installed R NNS 12.1 beta,
7
7
implemented natively in Python on top of NumPy and SciPy. It does not
8
8
wrap R, call the R package at runtime, or depend on compiled R/C++ shims. The
9
9
goal is public input/output compatibility where R behavior is stable,
@@ -17,7 +17,7 @@ largest remaining API work is now mostly ergonomic: categorical predictor
17
17
preparation is explicit through `prepare_factor_predictors(...)`, while direct
18
18
raw-factor `nns_m_reg(..., factor_2_dummy=True)` remains guarded because the
19
19
installed R internal path errors. Named R data-frame factor ordering quirks are
20
-
documented as outside PyNNS' positional-column API boundary. Performance gaps
20
+
documented as outside NNS Python' positional-column API boundary. Performance gaps
21
21
remain mostly in large stochastic-dominance workloads where R uses compiled
22
22
kernels.
23
23
@@ -57,7 +57,7 @@ invariant, and property coverage.
57
57
| Nowcast panel: `nns_nowcast_panel`| implemented | medium | Python-native deterministic monthly panel helper backed by `nns_var`. R NNS 12.1 beta removed `NNS.nowcast`, so this is no longer an R-export parity target. |
58
58
| Providers: `CsvNowcastProvider`| implemented | medium | Produces explicit local/offline payloads for `nns_nowcast_panel`. |
59
59
| Bootstrap/Monte Carlo: `nns_meboot`, `nns_mc`| implemented | medium | Deterministic diagnostics are parity-tested; exact stochastic replicate parity with R is not expected. |
60
-
| Stochastic dominance/superiority: `fsd`, `ssd`, `tsd`, `.uni` wrappers, `nns_ss`, `nns_sd_cluster`, `sd_efficient_set`| implemented | medium | Public structures and deterministic paths are covered. SD uses exact pure-NumPy prefix-pair kernels plus a degree-1 discrete order-statistic matrix path; R's C++ core remains faster on full finance fixtures. Stochastic intervals use PyNNS RNG. |
60
+
| Stochastic dominance/superiority: `fsd`, `ssd`, `tsd`, `.uni` wrappers, `nns_ss`, `nns_sd_cluster`, `sd_efficient_set`| implemented | medium | Public structures and deterministic paths are covered. SD uses exact pure-NumPy prefix-pair kernels plus a degree-1 discrete order-statistic matrix path; R's C++ core remains faster on full finance fixtures. Stochastic intervals use NNS Python RNG. |
61
61
| ANOVA: `nns_anova`| implemented | high | Binary, multi-group, pairwise, and degenerate `NaN` conventions are covered. |
62
62
| Normalization: `nns_norm`| implemented | high | Numeric matrix path is implemented. |
63
63
| Categorical helpers: `encode_factor_codes`, `factor_2_dummy`, `factor_2_dummy_fr`, `prepare_factor_predictors`| implemented | high | Explicit `levels=` / `factor_levels=` should be used to reproduce R factor ordering. `prepare_factor_predictors(...)` exposes the regression-ready full-rank design matrix path. |
@@ -69,24 +69,24 @@ invariant, and property coverage.
69
69
| Area | Path | Current behavior | Reason / next action |
70
70
|---|---|---|---|
71
71
| Multivariate regression | direct `factor_2_dummy=True` raw predictor path | Guarded with `NotImplementedError` in direct `nns_m_reg(..., factor_2_dummy=True)`. | Installed R direct `NNS.M.reg` raw factor input errors. Use `prepare_factor_predictors(...)` first, or use the public `nns_reg(..., factor_2_dummy=True, factor_levels=...)` expansion path. |
72
-
| Boost |`threshold` on the `n_features > 10` stochastic path | Guarded with `NotImplementedError` on the high-feature stochastic epoch path. | Installed R errors because `test.features` is never built. PyNNS keeps this explicit. |
73
-
| Boost/factor predictors | named data-frame factor predictor ordering | Deferred, not represented as a named-column API. |PyNNS uses positional `X1`, `X2`, ... semantics. Installed R named data frames can reorder columns alphabetically before `data.matrix`. |
72
+
| Boost |`threshold` on the `n_features > 10` stochastic path | Guarded with `NotImplementedError` on the high-feature stochastic epoch path. | Installed R errors because `test.features` is never built. NNS Python keeps this explicit. |
73
+
| Boost/factor predictors | named data-frame factor predictor ordering | Deferred, not represented as a named-column API. |NNS Python uses positional `X1`, `X2`, ... semantics. Installed R named data frames can reorder columns alphabetically before `data.matrix`. |
74
74
75
75
## Intentional Design Boundaries
76
76
77
77
- No hidden network fetching happens by default.
78
-
-PyNNS does not export `nns_nowcast`; R NNS 12.1 beta removed `NNS.nowcast`.
78
+
-NNS Python does not export `nns_nowcast`; R NNS 12.1 beta removed `NNS.nowcast`.
79
79
- Nowcast providers are payload builders for `nns_nowcast_panel`, not implicit
80
80
public forecast wrappers.
81
81
-`CsvNowcastProvider` is local/offline.
82
82
- Library code does not auto-load `.env` files.
83
83
- External data clients and dataframe libraries are not dependencies.
84
-
-PyNNS uses explicit Python errors for some cases where R silently truncates,
84
+
-NNS Python uses explicit Python errors for some cases where R silently truncates,
85
85
coerces, warns, or returns unusable values. Important divergences are recorded
86
86
in `docs/conventions.md`.
87
87
- Stochastic exact stream parity is not expected. Stochastic paths use NumPy RNG
88
88
and are tested structurally/statistically.
89
-
- Plotting side effects from R APIs are generally ignored; PyNNS returns data.
89
+
- Plotting side effects from R APIs are generally ignored; NNS Python returns data.
90
90
- Stochastic-dominance performance work stays pure NumPy for alpha. The current
91
91
implementation mirrors R's sorted-column/prefix-sum algorithm and adds
92
92
Python-specific guard pruning, kept-only active-set scans for degree 2/3 and
@@ -100,15 +100,15 @@ Nowcast provider support is explicit. Providers return payloads; callers pass
0 commit comments