Skip to content

Improve trend prediction behavior#9

Open
nimish wants to merge 1 commit intomainfrom
feat/tsgam-trend-improvement
Open

Improve trend prediction behavior#9
nimish wants to merge 1 commit intomainfrom
feat/tsgam-trend-improvement

Conversation

@nimish
Copy link
Copy Markdown
Owner

@nimish nimish commented Apr 22, 2026

Summary

  • simplify the nonlinear trend API to a single monotone decreasing mode across the estimator and example tooling
  • fix trend prediction on shorter windows by slicing the fitted trend vector to the requested period count
  • document and test that predict() still requires a regular timestamp grid without gaps

Test plan

  • uv run --project /Users/nimish/Projects/bennet/estimator/.worktrees/tsgam-trend-improvement --directory /Users/nimish/Projects/bennet/estimator/.worktrees/tsgam-trend-improvement pytest test/test_tsgam_trend.py test/test_tsgam_multi_frequency.py -q

Made with Cursor

Simplify the nonlinear trend API, make shorter prediction windows reuse the fitted trend safely, and keep prediction validation aligned with the regular-grid contract.

Made-with: Cursor
@nimish nimish requested a review from bmeyers April 22, 2026 18:46
@github-actions
Copy link
Copy Markdown

Test Results

149 tests  +5   149 ✅ +5   51s ⏱️ -1s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit cd25b55. ± Comparison against base commit 411b541.

This pull request removes 3 and adds 8 tests. Note that renamed tests count towards both.
test.test_tsgam_trend ‑ test_explicit_nonlinear_decreasing_is_nonincreasing
test.test_tsgam_trend ‑ test_explicit_nonlinear_increasing_is_nondecreasing
test.test_tsgam_trend ‑ test_legacy_nonlinear_alias_remains_nonincreasing
test.test_tsgam_trend ‑ test_predict_beyond_training[linear]
test.test_tsgam_trend ‑ test_predict_beyond_training[nonlinear]
test.test_tsgam_trend ‑ test_predict_full_range[linear]
test.test_tsgam_trend ‑ test_predict_full_range[nonlinear]
test.test_tsgam_trend ‑ test_predict_gapped_subset[linear]
test.test_tsgam_trend ‑ test_predict_gapped_subset[nonlinear]
test.test_tsgam_trend ‑ test_predict_subset_before_end[linear]
test.test_tsgam_trend ‑ test_predict_subset_before_end[nonlinear]

@github-actions
Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/tsgam_estimator
  tsgam_estimator.py 1740-1741, 1856, 1924
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant