Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NNS is built around partial moments, the lower and upper components of variance,
|---|---|
| Distribution package | `ovvo-nns` |
| Import package | `nns` |
| Current version | `1.2.0` |
| Current version | `1.3.0` |
| Python | `>=3.11` |
| Required runtime dependencies | NumPy, SciPy |
| R required at runtime | No |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ovvo-nns"
version = "1.2.0"
version = "1.3.0"
description = "Python port of nonlinear nonparametric statistics from R NNS"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion src/nns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from nns.pm_matrix import pm_matrix as pm_matrix

__version__ = "1.2.0"
__version__ = "1.3.0"

_EXPORTS = {
"BoostResult": ("nns.boost", "BoostResult"),
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmarks/_r_baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
"pm_matrix_50x500_seconds": 0.0072,
"sd_efficient_set_50x252_degree2_seconds": 0.0044
},
"nns_version": "12.1",
"nns_version": "13.0",
"schema_version": 1
}
2 changes: 0 additions & 2 deletions tests/benchmarks/test_lpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,6 @@ def test_nns_boost_factor_predictor_50x2(
variable[:10],
learner_trials=10,
cv_size=0.25,
factor_levels=(["low", "mid", "high"], None),
feature_importance=False,
)

Expand Down Expand Up @@ -926,7 +925,6 @@ def test_nns_boost_multi_factor_predictor_50x3(
variable[:10],
learner_trials=10,
cv_size=0.25,
factor_levels=(["low", "mid", "high"], None, ["down", "up"]),
feature_importance=False,
random_seed=1,
)
Expand Down
15 changes: 15 additions & 0 deletions tests/invariants/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ def test_nns_stack_numeric_shapes_and_keys() -> None:
assert np.all(np.isfinite(result["stack"]))


def test_nns_stack_accepts_duplicate_predictor_columns() -> None:
# Parity with nns_reg: the cbind(x, x) dimension trick must work for
# nns_stack too. R NNS.stack historically rejected duplicate predictor
# names ("[IVs.train] predictor names must be unique."); the Python port
# never had that restriction and must keep accepting duplicate columns in
# both the training matrix and the point-estimate matrix.
rng = np.random.default_rng(123)
x = rng.standard_normal(60)
y = rng.standard_normal(60)
variable = np.column_stack((x, x))

result = nns_stack(variable, y, variable[:5], method=(1,), folds=2, cv_size=0.25)

assert result["reg"].shape == (5,)
assert np.all(np.isfinite(result["reg"]))


def test_nns_stack_pred_int_falls_back_to_point_estimate_when_regression_drops_rows() -> None:
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading