Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Source repository: https://github.com/EDF-Lab/tam
The first official open-source release of the TAM framework under this structure is 1.2.3.
⚠️ Note: Versions 1.1.1–1.2.2 correspond to internal development milestones and were not publicly released.
0.0.6 corresponds to the legacy
weaklpackage available on PyPI.
1.6.1 - 2026-11-18¶
Added¶
Added Bochner QMC RFF spectrum effect (
pspec,PriorSpectralEffect).Added HiPPO state-space memory spectrum effect (
hippo,HiPPOEffect).Added Performer FAVOR+ causal attention spectrum effect (
attn,TransformerEffect).Added Bispectrum quadratic phase-coupling spectrum effect (
bispec,BispectrumEffect) andhinich_bispectrum_test.Added Wavelet Scattering spectrum effect (
wst,ScatteringEffect).Added T-JEPA exogenous latent spectrum effect (
tjepa,TJEPAEffect) with a closed-form encoder (mode="svd", default) and a self-supervised gradient encoder (mode="vicreg").Added Fourier Neural Operator spectrum effect (
fno,OperatorEffect).Added Hurst fractional Brownian motion spectrum effect (
hurst,HurstEffect).Added Caputo fractional derivative orders to
UniversalPhysicsEffect(integerphys()unchanged).Added Exp-Centered Unit (
activation='exu') mode toNeuralEffect.Added Singular Spectrum Analysis spectrum effect (
ssa,SSAEffect).
1.6.0 - 2026-11-18¶
Added¶
Added opt-in causal state continuation (
state_in/continue_state=True) inBaseTAM,StaticTAM, andbuild_phi_from_effects.Added opt-in Preconditioned CG, Block-QR, Hutchinson Rademacher trace, Wood analytical GCV gradient, Square-Root Group LASSO, and scale-stability penalty.
Added opt-in Sinkhorn entropic OT temporal coherence (
coherence_loss='sinkhorn') inHierarchicalTAMand Conformal Risk Control (calibrate_crc()/predict_crc_intervals()).Added Bernstein Online Aggregation (
algorithm='BOA') andHierarchicalOperaTAM.Added
TwoTierOperaTAM, another name forHierarchicalOperaTAM.Added causal path signature spectrum effect (
sig,SignatureEffect).Added penalized single-index distributed lag spectrum effect (
si,SingleIndexEffect).Added Kolmogorov-Arnold Network edge spline spectrum effect (
kan,KANEffect).Added physical RC thermal inertia spectrum effect (
inertia/thermal).Added smooth softplus degree-day spectrum effect (
dd/hdd_cdd,DegreeDayEffect).Added diffeomorphic warped calendar spectrum effect (
wcal,WarpedCalendarEffect).Added Hodrick-Prescott macro-trend spectrum effect (
hp_trend,MacroTrendEffect).Added Form B
TemporalOperatorEffect(op_attn,op_hippo,op_ssa).Added
PatchBasisEffect(patch_basis) with Causal RevIN and Level-2 Lévy Area hysteresis.Added
FoundationEffect(foundation) universal closed-form basis.Added Koopman EDMD spectrum effect (
koopman,KoopmanEffect).
1.5.1 - 2026-11-09¶
Patch release, tagged on the repository (no package upload). It carries the hierarchical group axis merged after 1.5.0, a fix of the Kalman filter on missing targets and of the memory budget of the group chunks, and a wider CI. A series without missing targets, and a panel that fits in memory, give the same forecasts as 1.5.0.
Added¶
HierarchicalTAMwith agroup_col: one hierarchical system per group (for instance per half-hour of the day). Every node keeps its group axis, all nodes must hold the same groups and the same number of rows per group, the global system is(G, D, D)and solved in one batched call; the dense CG and the matrix-free CG loop over the groups. The memory check counts theG * D^2 * 8bytes. A fit on G groups equals G separate fits, and a single group gives the same coefficients as before.HierarchicalTAM(align='strict' | 'inner'): the nodes are matched on(group, date)instead of on row position, and each node is sorted by(group, date).'strict'(the default) raises when the nodes do not hold the same keys and lists the first missing keys per node;'inner'keeps the keys every node has and warns with the rows dropped per node. Without adate_colthe nodes are matched by row position and must have the same number of rows.HierarchicalTAM.additivity_gap_: afterfit, per parentmax |Y_parent - sum Y_children| / mean |Y_parent|. A parent further than 0.1 % from the sum of its children is reported once by a warning.
Changed¶
HierarchicalTAM.fitassembles the joint system in_assemble_systemand solves it in_solve(no change of the results).HierarchicalTAMwith nodes that do not share the same dates now raises instead of silently comparing different dates (align='inner'keeps the previous convenience, restricted to the common dates).CI covers more numpy / pandas pairs and the built wheel:
tests.ymlhas acompatjob (numpy 2.0 + pandas 2.2.2, the oldest declared pair, must pass; pandas 2.3.3 and the newest numpy + pandas run with the pandasFutureWarnings and the numpy “generic unit”DeprecationWarningturned into errors, allowed to fail while their warnings are cleared) and awheeljob that installs the built wheel and runs the suite from a copy oftests/. The “generic unit” warning comes frompd.Timedelta(days=...)itself with numpy >= 2.5 and pandas 2.x (pandas 3 is clean); no call of this package is at fault.requirements.txthas the same lower bounds aspyproject.toml(numpy 2.0, pandas 2.2.2, scipy 1.14, matplotlib 3.9); the dependencies stay lower-bounded only.Which arguments change the forecast is written down and tested (
tests/test_parameters_with_effect.py, effect pages ofarchitecture/core/06_the_spectrum_api.md): the operator weights ofphys(), thescaledfactor ofl()and the difference order of an ordinalc()are hidden by the default penalty (ap=-9) and act with an explicit one;f()has noscaledargument (a value given is ignored); a spline gives the same forecast withextrapolate='continue'and'constant', a linear term with'continue'and'linear'. No result changes.
Fixed¶
StaticTAMon a panel of many groups and many features ran out of memory (group_colwith, for instance, 4 000 groups of 80 rows and 4 000 features, a request of about 490 GB): the group chunk of the direct solver was sized on the design matrixN x Donly and held every group at once, although theD x Dcovariance of each group is the larger tensor on a short series. The covariance is now part of the budget of a chunk (get_safe_group_batch_size), so the groups are solved in chunks that fit. A panel that fits in memory is solved in one chunk and gives the same coefficients as before; a panel that had to be split gives the same coefficients up to rounding (about 1e-11 relative).KalmanTAMno longer becomes more confident on a missing target: a row without a target left the state mean unchanged but still shrank the state covariance as if it had been observed, so after a run of missing days the filter was too sure of itself and reacted late when the truth came back. The regressors of the rows without a target are now zeroed in the gain and the covariance update (the block update equals the exact update on the observed rows), the process noise is still added at every step, and the forecast and its variance keep the full regressors. Series without missing targets give the same forecasts as before.
1.5.0 - 2026-10-20¶
Minor release for the non-Gaussian losses and for richer effects. New arguments and options are appended after the existing ones and their defaults keep the previous behaviour, so existing calls give the same forecasts. The exceptions are fixes: auto_fit() and grid_search_fit() on a non-Gaussian loss now use that loss (they used to score the raw response with an identity link), and phys(x, basis='neural') no longer crashes at fit.
Added¶
auto_fit(criterion='reml'): the smoothing parameters maximise the Laplace restricted marginal likelihood (analytic gradient, L-BFGS onlog(lambda)) instead of the GCV score, for the Gaussian and the GLM losses and for every smoothing coordinate (m_pen,te()margins,mode='per_level'). On a sine with AR(1) noise (300 rows, 25 knots, 12 seeds) the error against the true curve is 0.131 against 0.157 with GCV. The fitted model keepssmoothing_criterion_andreml_score_. The default stays'gcv', unchanged.n(..., orthogonalize=True)andt(..., orthogonalize=True): the neural or tree block is projected on the orthogonal complement of the rest of the design (intercept, splines, linear terms), estimated once on the training rows, so that it explains only what the interpretable terms cannot. Ony = sin(x1) + x2^2 + 1.5 x1 x2, the spline ofx1is 0.81 off the true main effect without the projection and 0.06 with it, at the same total error. DefaultFalse: unchanged.te(s(x), c(group), mode='per_level')(factor-smooth with one smoothing parameter per level, plus the ridge of the factor, forauto_fit) andl(z, raw=True)(varying-coefficient slope on the raw covariate: the interactionte(s(x), l(z, raw=True))is exactly zero wherez = 0).mode='shared'(the default) andl(z)are unchanged.c(..., unseen='edge' | 'mean' | 'zero'): what a code that is none of the levels takes.'edge'(the default, the behaviour so far) is the effect of the nearest edge level;'mean'is the mean of the level effects weighted by their training rows, the proxy of an average level;'zero'is no categorical effect (intercept and other terms only). Such a code never raises.Distributional
StaticTAM: weighted refit of the location, debiased scale, and a record of the fit (dist_kwargs):refit_roundsrefits the location with the inverse-variance weights of the scale model and alternates until the fitted location moves by less thanrefit_tol(the efficient estimator under a heteroscedastic noise; a line over a noise whose spread varies five times loses about 40% of its error, a 25-knot spline gains almost nothing);scale_correction="leverage"(or"edf") divides the squared residuals of the scale model by1 - h(the leverage of the location), which removes the downward bias of the scale and the too-narrow intervals of a flexible location on a small sample (the variance of the scale was 17% too low at 150 rows, within 2% with the correction).StaticTAM.leverage(data)returns the leverage of each row. The fit recordsrefit_history_,n_refits_,converged_andlog_likelihood_. The defaults (refit_rounds=0,scale_correction="none") are the previous fit, bit for bit.c(region, topo='graph', coords='x:y', k_neighbors=6)spatial levels: a Markov random field over the levels, with the k nearest centroids (mean of the coordinates of the rows of each level) as neighbours and the graph Laplacian as penalty, so a region with few observations borrows strength from the regions around it. A region without any training row has no centroid and keeps the zero effect.rbf(x1, others='x2', kernel='tps')thin-plate spline: parameter-free radial basis on data-driven centres, bending-energy penalty \(Z^\top E Z\) on the radial part, polynomial part of degree belowm(defaultm=2,2m > d), isotropic, with the optionalap_nullas a second smoothing parameter forauto_fit. The default extrapolation of this kernel islinear. The Gaussian and Matérn kernels are unchanged.s(x, m_pen=m)locally adaptive penalty: the roughness penalty of a P-spline is split inmlocally weighted parts (smooth B-spline weights that add up to one), each with its own smoothing parameter forauto_fit, so a curve that is flat over most of its range and sharply curved in a narrow window is not oversmoothed there.m_pen=1(the default) is the ordinary penalty, unchanged; equal parameters give it back exactly;te(...)margins with several coordinates are supported.AdaptiveTAMon the base of a non-Gaussian loss (poisson,negative_binomial,tweedie,gamma,binomial): the windows are fitted as GLMs on the linear predictor, with the link of the base forecast as an offset, so the adapted forecast keeps the support of the family (no negative counts after a stretch of zeros) and a multiplicative drift is tracked on the log scale.Estimated<target>is still the correction andAdaptedEstimated<target>the adapted mean.predict_quantilesreturns the quantiles of the family at the adapted mean for the count and Tweedie bases.clip_to_train_rangeis refused for such a base. The Gaussian base is unchanged.offset(col)in a formula: an exposure term with the raw column and a fixed coefficient 1 (no parameter, no extra column in the design matrix),eta = offset + Phi theta, for the Gaussian fit, the reweighted fit of the GLM losses,auto_fit,grid_search_fit,predictanddecompose_prediction(columneffect_offset_<col>). A rate model isy ~ offset(log_E) + s(x)withloss="poisson"; doubling the exposure of a row doubles its predicted mean exactly. Another term may not read the same column;AdaptiveTAM,KalmanTAMand the mixture mode do not read offsets.c(col)withoutn_cattakes the distinct integer codes of the training rows as its levels (nominalandordinaltopologies): a code set such as{10, 50, 1000}gives three columns instead of 1001, and the order of the rows or the gaps between codes change nothing. A feature that another effect also reads (l(g) + c(g)) andgrid_search_fitkeep the previous level range0 .. max code.target_transformon a plainStaticTAM("log","log1p","asinh","logit","boxcox", withtransform_kwargsfor the shift, the Box-Cox exponent, the centre and scale, the bounds, andmean_correction=True): the model is fitted on \(g(y)\),predictreturns the response scale andpredict_quantilesinverts the quantiles of the model-scale residuals, so the quantiles are exact and a"logit"target stays inside its bounds.log1pandboxcoxare also available indist_kwargs={"target_transform": ...}of the distributional mode. A GLM loss, a dict formula and a mixture refuse the argument.Proper scores for the non-Gaussian families:
tam.evaluation.unit_deviance,deviance_explained(the proportion of deviance explained \(D^2\), equal to \(R^2\) for the Gaussian family) anddeviance_metric;calculate_regression_metrics(..., family=...)addsDevianceandD2(its keys are unchanged without a family).DragTAM,ExpertExpanderandEnsembleSelectoraccept the metric namespoisson_deviance,gamma_deviance,binomial_deviance/logloss,negative_binomial_devianceandtweedie_deviance.
Changed¶
A term
c()with a single level (a flag that is constant in the training rows) keeps that level for every row, as before.Faster fits for the non-Gaussian losses (
poisson,gamma,binomial,negative_binomial,tweedie): the iteratively reweighted loop builds the design matrix once per fit instead of once per pass and per step-halving, and the dispersion refits of the negative binomial and Tweedie losses share it. Same coefficients to \(10^{-10}\); about seven times faster on 30 000 rows. When the matrix does not fit in memory the loop builds it by blocks as before.
Fixed¶
phys(x, basis='neural')crashed at fit ('NoneType' object has no attribute 'flatten': the penalty read the network weights before they existed). The neural weights, the wavelet grid and the basis of aphys()term are now set from the whole training tensor before the penalty is built;grid_search_fit(static and adaptive) does the same for its candidate effects, so a thin-plate, graph or orthogonalised candidate is no longer built on an identity penalty. A graph term with a missing level only warns.auto_fit()andgrid_search_fit()on the non-Gaussian losses (poisson,gamma,binomial,negative_binomial,tweedie): both ignored the loss.auto_fit()scored the raw response with an identity link, so the coefficients were least-squares ones thatpredict()then passed through the inverse link, which could explode;grid_search_fit()scored the validation set without the inverse link and returned a model without the loss.auto_fit()now runs a working-weight GCV (the search scores the working response and Fisher weights of the reweighted fit, and the final fit is the reweighted fit at the selected parameters), andgrid_search_fit()fits each candidate by the reweighted loop, scores it on the response scale, keeps the loss on the returned model and stores the winning score invalidation_rmse_. The Gaussian path is unchanged.Two display equations of the theory pages were shown as raw text (the section on counts and zero-inflated targets of
math/statistics/01_reweighted_estimation.md, and the list of conformal steps ofmath/statistics/04_risk_conformal_evt.md): a display equation needs a blank line before and after it, also inside a list item.tests/test_docs_math_blocks.pychecks it on every page ofmath/andarchitecture/.
1.4.1 - 2026-10-08¶
Patch release for probabilistic forecasting: new methods and options only, plus one fix. Existing calls give the same forecasts; the only change of behaviour is that a distributional or mixture StaticTAM with the default log target now raises on a training target with values <= 0 instead of returning a meaningless model (see “Fixed”).
The
DCOsign-off is required on every commit of a pull request (DCO,CONTRIBUTING.md,docs/contributing/dco_howto.md); aREUSEworkflow runsreuse linton each push and pull request.The
pid()page ofarchitecture/core/06_the_spectrum_api.mdsays whend_penacts and that the derivative is computed along the frame given topredict(); three tests pinpidbehaviour.
Added¶
Limiting the CPU threads is documented and tested (
architecture/core/04_hardware_memory.md, README): setOMP_NUM_THREADSandMKL_NUM_THREADSbefore starting Python. The page also describes a hang oftorch.set_num_threads(n)seen on one PyTorch / oneMKL build, which reproduces withouttam; the results oftamare unchanged.loss="negative_binomial"andloss="tweedie"onStaticTAM(log link): overdispersed counts, and positive targets with exact zeros (sparse retail, rain, night-time solar). The negative binomial dispersion is estimated by maximum likelihood after the IRLS fit (or fixed withloss_kwargs={"dispersion": alpha}); the Tweedie power isloss_kwargs={"power": p}with1 < p < 2(1.5 by default) and its dispersion is the Pearson estimate. The estimate ismodel.dispersion_. A negative target raises aValueError.StaticTAM.predict_quantiles(data, taus)forpoisson,negative_binomialandtweedie: discrete quantiles for the counts and the quantiles of the compound Poisson-gamma law for Tweedie, which are0where the probability of zero exceeds the level; non-negative and non-decreasing in the level by construction. The Poisson loss is otherwise unchanged.KalmanTAM.predict_quantiles(data, taus): Gaussian quantiles of the online forecast from the predictive variance of the filter,x' P x + Rin the target scale (forhorizon_steps > 1, the covariance of the delayed state grown by the process noise of the delay). Returns a DataFrame withq<tau>columns, like the distributionalStaticTAM; likepredict_online,dataholds the target. The constructor,predict_online,predictandfitare unchanged. The intervals are as calibrated asobservation_noise_varandprocess_noise_varare.AdaptiveTAM.predict_quantiles(data, taus): online quantile forecasts when thebase_modelis a distributionalStaticTAM(a dict formula). The adaptive correction moves the location; the scale of the base is rescaled at each update by the root mean square of the standardized residuals of the lasttraining_window_periodsrows that are at leasthorizon_stepsold (past residuals only), and the quantiles go back through the target transform of the base. Returns a DataFrame withq<tau>columns, like the distributionalStaticTAM; likepredict_online,dataholds the target. A plain base raises aValueError.predict_online,predictandfitgive the same results as before for a plain base, and now also accept a distributional one.dist_kwargs={"target_transform": "asinh" | "logit"}on a distributionalStaticTAM: the location-scale law sits onarsinh((y - c) / s)(centre and robust scale estimated on the training target; a skewed, heavy-tailed target with negative values, such as electricity prices) or on the logit of(y - a) / (b - a)(a target bounded inbounds=(a, b), estimated from the training range when not given).predict_median,predict_quantile(s),cdf,crps,anomaly_scoreand the conformal intervals work through the transform, and quantiles stay inside the bounds for the logit.target_transform="log"is the default and the same aslog_target=True;"none"the same aslog_target=False. A mixture accepts"none"and"log"only.f(x, ..., period=...): the range of one cycle of a Fourier input, on which the feature is normalised inStaticTAMand in each rolling window ofAdaptiveTAM.period=None(default): the minimum and maximum of the training rows, as before.period='auto': first value to last value plus one step, the step read from the training rows (hours 0 to 23 give (0, 24), months 1 to 12 give (1, 13)).period=(low, high): given, for a history covering only part of the cycle ((0, 1)for a time of year trained on half a year). Without it the training range is still taken as one period, which glues the last value of an integer-coded position onto the first (f(hour, cyclic=True)with hours 0 to 23 forces 23:00 = 0:00; Sunday = Monday for 0 to 6; December = January for 1 to 12) and reads a history covering half a year (or a 60-day adaptive window) as a whole year: use'auto'for the first case and a given range for the second. Results withoutperiodare unchanged.OperaTAM(..., loss_type='pinball', tau=0.9): online aggregation of quantile forecasts with the pinball loss of leveltau(MLpol and EWA).tam.model.opera.aggregate_quantiles(df, target_col, expert_cols_by_level)aggregates every level and sorts them on each row. The square and absolute losses are unchanged.SafetyTAM.predict_quantiles(y_pred, levels, scale=None, signed=False): conformal quantiles at several levels in one call (q<level>columns, sorted on each row). By default the symmetric bands ofpredict_intervals;signed=Truecalibrates each tail on the signed residuals kept bycalibrate()(one-sided split conformal), for skewed errors.calibrate(..., verbose=False)silences the sample-count line, printed by default as before.
Fixed¶
A distributional or mixture
StaticTAMwith the default log target rejects a training target with values<= 0(ValueErrornaming the count anddist_kwargs={"log_target": False}). They were clipped to a tiny constant before the log, i.e. silently turned into huge negative outliers, and the fitted location, scale and quantiles were meaningless. Positive targets are unchanged.
1.4.0 - 2026-10-06¶
First release on PyPI and Zenodo since 1.3.1; it also carries everything of 1.3.2 to 1.3.4, which were tags only. AdaptiveTAM, KalmanTAM and NeuralTAM [EXP] forecasts change (see 1.3.3, 1.3.4 and the sections below); StaticTAM changes only for te() with GCV (-2%), a mixture mean (-0.6%) and a prediction without the group column. To get the 1.3.1 behaviour: pip install tam-ml==1.3.1.
Changed¶
A formula with an empty argument is rejected (
s(x,,k=5),s(x, k=5,),te(s(x),, s(z))):split_args_respecting_parenthesesnow raises aValueErroron a leading, trailing or doubled delimiter and on unbalanced parentheses (it used to ignore a trailing empty argument silently). Contributed by Amaury Durand.te()has one smoothing parameter per margin (mgcv semantics):auto_fit(GCV) tunes the weight of each margin separately, so a tensor product can be smooth along one axis and rough along another (before, the margins were multiplied by one weight GCV could barely move: on a planez = x + ythe surface used 76 effective degrees of freedom, now 4). A weight given to the tensor product itself (te(..., ap=)or the default) is folded into each margin once; with fixed weights the penalty is unchanged (forecasts are bit-identical), butauto_fitresults with ate()change, because the search can now move the penalty: a largergamma(2.0) can now select an over-smoothed surface,gamma=1.4(the default, kept) selects the same fit as before in the cases measured.auto_fitreports andsummary()show one value per margin. New effect API:penalty_coordinates(),set_penalty_coordinates(),n_penalty_coordinates(one coordinate for every effect but a tensor product).auto_fitdefaultgamma=1.4kept after re-tuning on the fixed engine: no other value improves the validation RMSE by more than 0.5% on most cases, and 1.0 can be much worse (see the v1.4.0 Pull Request description on GitHub for the full benchmark and engine diagnosis).NeuralTAMis reproducible (NeuralTAM(..., seed=42)): the validation split, the epoch shuffling and the network initialisation use their own generators, so a fit depends onseedand not on the random draws made before it, and it neither reads nor advances the global torch generator. Neural results change once (the draws are not the same as before); they are then stable.NeuralTAM(guard=True)keeps a network only where it beats, on the validation rows, the closed-form effect it replaces;network_used_says where, aUserWarningis raised when no network is kept (the model then equals itsStaticTAM), andguard=Falsekeeps every network as before.
Added¶
API contract tests (
tests/test_api_contracts.py): the signatures of the main models and of the formula parser, thedecompose_predictioncolumn names and thesummary()keys are pinned; adding a keyword argument with a default passes, changing an existing parameter fails.KalmanTAM(process_noise_var={term: q, "offset": q, "default": q}): one process noise per formula term (a diagonalQ); every design column of a term gets the term’sq, the terms not named use"default"(1e-4). A float works as before, bit for bit.KalmanTAM.term_columns()lists the terms and their columns;tune_hyperparametersaccepts one candidate dict per grid entry.A use-case workflow in CI (
.github/workflows/use_cases.yml): every script ofuse_cases/runs headless on each push and pull request ofmain,automl,feat/**andrelease/**, one job per script, and oneUse casescheck fails when any of them does.Regression checks, one script per functionality (
tests/regression/): 38 scripts (every family of effects, every argument of every effect, mixed formulas and their decomposition, interactions, fixed and GCV fits, losses, distributional and conformal, the prediction API,AdaptiveTAM,KalmanTAM,OperaTAM,HierarchicalTAM,NeuralTAM, the errors and warnings a user meets, hyper-parameter search, a smallAutoTAM, plots, the extrapolation of splines) run on one frozen year of the FORCE dataset and writetests/regression/RESULTS.txt(stable modules) andRESULTS_EXP.txt(beta and experimental ones), text files that are committed. ARegressionworkflow reruns them on every pull request and fails whenRESULTS.txtchanges: the diff is what the maintainer reviews; a change of the experimental file is only a warning. They need only tam, take about two minutes, and do not depend on the datasets shipped with the package.One license header in every source and test file:
SPDX-FileCopyrightTextlines, oneSPDX-FileContributorline per author (the free-text# Author(s) :lines became contributor lines, nothing was lost), thenSPDX-License-Identifier;REUSE.tomlcovers the files that carry no header andLICENSES/LGPL-3.0-or-later.txtholds the license text (REUSE layout).tests/test_spdx_headers.pychecks the shape.Contributor files:
.github/CODEOWNERS(every path reviewed by the maintainer), a pull request template (one checklist row per CHANGELOG line, plus the pre-push verdict), issue templates (bug, feature, research), andCONTRIBUTING.mdsections on shared feature branches (fork, pull request intofeat/*, two review slots a week with a three-working-day turnaround) and onprint()in new code. The README,AUTHORS.mdand the citation file no longer mention a journal evaluation: the citation file has no placeholder identifier.AdaptiveTAMwarns when a forecast level was not in the training rows of its window (TAMExtrapolationWarning, once per categorical feature and model): a holiday seen for the first time, or a weekday missing from a short window, gets a penalised near-zero column silently; the message gives the level(s) and in how many windows it happens. Silent without a categorical term;collect_extrapolation()collects it like the range warning.compact()onStaticTAM,AdaptiveTAM,KalmanTAMandOperaTAM: drops what grows with the data (predictions_, the state and weight histories except their last row) and returns the model;predict()is unchanged to the last bit. See “Model size and persistence” in the architecture notes.
Fixed¶
AdaptiveTAMfrees its simulation cache whenpredict_online(),fit()orgrid_search_fit()ends. Previously, every overlapping window was kept stacked in memory, accounting for the vast majority of the model’s pickled size. The model footprint is now drastically reduced, andcompact()makes the size of a fittedAdaptiveTAM,KalmanTAMorOperaTAMindependent of the data.prepare_simulation()alone still fillssimulation_data_.OperaTAMandNeuralTAMaccept a frame whose columns are stored in another order than the formula lists them: with pandas 3, selecting the expert (or network input) columns in the reverse of their storage order gave a view with negative strides that torch refuses (ValueError: At least one stride in the given numpy array is negative); the tensors are now built from a contiguous copy, and the forecasts do not depend on the column order.NeuralTAM.decompose_predictionnames a network’s effect like the other models (effect_n_xwhenxalso has as()orl()term, asStaticTAMdoes): it added a strayeffect_xcolumn next to theeffect_n_xone, so the effects no longer summed to the forecast and anAdaptiveTAMbehind aNeuralTAMsaw a different set of columns than behind aStaticTAM. Formulas where the network is the only term on its feature are unchanged.NeuralTAMbackfitting started from zero for a network on a feature shared with another effect (l(x) + n(x)): it looked for the closed-form contribution under the wrong column name, so the network learned the residual left after that effect and then replaced it; a network on a shared feature was several times worse than the closed-form model. It now starts from the closed-form contribution.NeuralTAMnetworks no longer stall at the start of the training: a plateau scheduler halved the learning rate while the validation loss was still flat (the last layer starts at zero), so a network with the default training ended up worse than the closed-form effect it replaces (on a line, three times worse). The rate now stays atlrand early stopping alone ends the training.Predictions on a frame with duplicate index labels (
pd.concatwithoutignore_index), interleaved groups or rows not in date order: every prediction and everydecompose_predictioneffect is placed on its own row (by position, in date order inside each group); the engine used to fail on repeated labels, anddecompose_predictionput the effects of a group in frame order, wrong when the rows were not in date order.
1.3.4 - 2026-10-02¶
Patch release (tag on main; the latest release on PyPI and Zenodo stays 1.3.1): AdaptiveTAM now gives what an operational refit would, and StaticTAM says when a forecast leaves the trained range. AdaptiveTAM forecasts change; StaticTAM changes only for a categorical level absent from training. To get the 1.3.3 behaviour, use the tag v1.3.3.
Changed¶
AdaptiveTAMequals a rollingStaticTAM(fiton the training rows of a window,predicton the next rows, to numerical precision): each window is normalised with its own training rows (it used the whole period), forecasts are no longer clipped to the whole-period range (clip_to_train_range=Trueclips each window to its own), windows are anchored on the start of the data, features and targets arefloat64, and the rows added to balance groups are never trained on. Rows before the first window areNaNinEstimated...(they were 0);AdaptedEstimated...keeps the base model forecast there when there is a base model.AdaptiveTAM.fit()thenpredict()uses the window a refit holds after the last row, with its own normalisation:fit(history up to day t).predict(day t+1)equals the simulation’s forecast for day t+1.Categorical codes (
c()with ann_catgiven in the formula) are normalised on the full level range0 .. n_cat - 1, so a level absent from training keeps its own column instead of landing on an edge level. Codes1 .. n_cat, non-integer codes and an inferredn_catkeep the min/max rule.
Fixed¶
Spline knots (
s()): set from the full training tensor, no longer from the solver’s memory probe, which could cache degenerate knots when the first row of every group sat on the upper edge of its range.
Added¶
ta.TAMExtrapolationWarning: once per model and feature, when a feature read by a non-linear effect (s,f,p,w,rbf,n,t,phys,temargin) leaves its trained range by more than 1% of its half-range, or a categorical level was not seen in training (AdaptiveTAM: one warning for all windows;AutoTAMlists them insummary()).l()never warns; the default extrapolation does not change.TAM [Info]at training: ac()term with a givenn_catsays which levels the training rows lack.ta.rolling_windows(...)yields the(train_rows, forecast_rows)of eachAdaptiveTAMwindow, to write the reference loop.AdaptiveTAM(clip_to_train_range=False)clips each window’s forecast to the range of its own training rows whenTrue.
1.3.3 - 2026-10-01¶
Patch release (tag on main; the latest release on PyPI and Zenodo stays 1.3.1): KalmanTAM no longer looks ahead and updates its state at every step.
KalmanTAM forecasts change; the only other change is the fix of s() on one-row frames and on a single out-of-range value below. Everything else is identical to 1.3.2. To get the 1.3.2 behaviour, use the tag v1.3.2 (or block_size=128 for the update rule alone).
Changed¶
Causal scaling (
KalmanTAM): the feature normalisation and the target scale (y_max - y_min) were computed on the whole online period, so every forecast depended on observations after it, and the scale set the effective observation and process noise. They now come from a reference period: the firstcalibration_stepsrows of each group, or a separatecalibration_data. A forecast at or before row r no longer changes when later rows change. With data whose range never changes after the reference rows, the forecasts are identical to 1.3.2 (checked to the last bit, with and without a base model).Update at every step (
KalmanTAM): withhorizon_steps=1the defaultblock_sizewas 128, so the state moved only every 128 steps (every 128 days withgroup_col="tod") while the docstring promised standard online filtering. The default is now the exact sequential filter (block_size=None, i.e. 1), which tracks the load more closely on the FORCE national load.fit()thenpredict()(KalmanTAM): the frozen state was the one the last row was forecast with, i.e. before that row’s update, so forecasting the next day fromfit(history)ignored the last observation.fit()now stores the state after the last update: withblock_size=1,fit(history up to day t).predict(day t+1)equals the online simulation’s forecast for day t+1 (checked on the FORCE national load, to numerical precision).
Fixed¶
s()predicted wrongly in two situations (StaticTAM,AdaptiveTAM,KalmanTAMbase features): a spline treated any one-element input as the solver’s one-row memory probe and rebuilt its knots from that single point instead of using the trained ones. It happened (1) on a frame with one row per group (tomorrow’s forecast for every half-hour withgroup_col="tod"), and (2) with the default linear extrapolation when exactly one value of a frame was outside the training range, because the slope of the out-of-range values is computed on a tensor holding only those values (one element for one value). On the FORCE national load test year, a single half-hour just above its group’s training maximum was predicted orders of magnitude off. Splines now always use their trained knots. Frames with no out-of-range value, or with several, and frames with several rows per group are unchanged; the other effects (l(),c(),f(),w(),rbf(),t()) were already row-wise.
Added¶
KalmanTAM(calibration_steps=None, calibration_data=None):calibration_stepsis the number of rows per group, at the start of the data, that set the scaling (defaultmin(365, half the rows)). A message says those rows are not causal and should not be scored.calibration_datatakes the scaling from a separate historical DataFrame (for example the training set), so every online row can be scored. Acalibration_stepsthat leaves no row to track raises aValueError. The scaling is stored atfitand reused bypredict().KalmanTAM.tune_hyperparameters(..., calibration_steps=None, calibration_mask=None): the RMSE is computed on the time steps you choose (a slice, a list of positions or a boolean mask), not on the end of the data.
Deprecated¶
tune_hyperparameters(lookback_days=...)scored the lastlookback_days * 24steps of the data you passed, which is look-ahead when that is the period you report (and assumes hourly steps). It still works with aFutureWarning, as does calling it with no period; it is removed in 1.5.0.An explicit
block_size > 1now warns that the state is updated only everyblock_sizesteps.
1.3.2 - 2026-10-01¶
Patch release (tag on main; the latest release on PyPI and Zenodo stays 1.3.1): two crashes fixed. No prediction changes: every model that worked in 1.3.1 gives the same numbers.
Fixed¶
Grouped models predict a frame holding only some of their groups (
StaticTAMwithgroup_col):predictraisedValueError: Length of values (n) does not match length of index (0)anddecompose_predictionreturned NaN. The groups stacked from the frame were paired with the fitted group list by position, and the per-group coefficients were sliced by position in the stacked tensor, so a one-group frame would have used the first group’s coefficients. Prediction and decomposition now use the groups actually present: rows keep the input order and index, and a group never seen in training raises aValueErrornaming it.plot_componentno longer replicates its grid over every group.Silent overflow in log-target quantiles (
predict_quantile,predict_quantiles,predict_median,anomaly_score, mixturecomponent_meansandpredict_mean): a scale prediction far outside the training range gaveexp(...) = infand a silent numpyRuntimeWarning: overflow encountered in exp. The value is stillinf(it is beyond float64, and the columns stay ordered) but it comes with an explicitUserWarningnaming the quantity and the first rows.
1.3.1 - 2026-09-30¶
Patch release: fixes that made some models wrong (formulas with te() or several features in one term) or not reproducible (rbf(), trees).
Predictions change for the models below; everything else is identical to 1.3.0. To get the 1.3.0 behaviour: pip install tam-ml==1.3.0.
Changed¶
Formulas with
te()or several features in one term: they were fitted with mislabelled terms and now fit the formula as written; their errors drop sharply, and the ensembles built on them follow. The THEORY benchmark and its figures are regenerated with 1.3.1.auto_fit(GCV): now fits exactly the model GCV selected. GCV minimises an in-sample criterion, not the holdout error, so holdout results move in both directions.rbf(): centres are seeded and drawn from the whole training set; RBF models change once and are then reproducible.Trees on grouped data (
t(),lt()withgroup_col): splits and leaf counts come from the whole training set; results change, mostly for the better. Ungrouped trees do not change.NeuralTAM (experimental): may change slightly in scripts that fit
rbf()models before it, because both used to share the global torch random generator. A NeuralTAM fitted on its own after the sametorch.manual_seedis unchanged.Fixed-penalty models without these terms are identical to 1.3.0.
Added¶
tam.plot_component(model, data, component, kind="auto"): plots one additive component with a view chosen from its dimension: a curve for one feature, one curve per level forte(x, c), a 3D surface (orkind="heatmap"with the observed points overlaid) forte(x1, x2), evaluated on a regular grid for one group (group=, default the most frequent), a 3D scatter coloured by the contribution forte(x1, x2, x3). Rows with a non-finite contribution are skipped.tam.common.plotting.resolve_component(model, feature, component=None, color_by=None): the component a feature maps to under the new decomposition names.rbf(x, ..., seed=42): seed of the centre sampling (default 42, liken()andt()).
Fixed¶
Terms renamed by position (
StaticTAM._prepare_data): each effect’sfeature_namewas overwritten from the deduplicated feature list by position, so with ate()or several features in one term, the effects after it were relabelled (e.g.c(day_type_week)becametoy) and the fitted model changed, not only the labels (e.g. a national-load model withte(temperature, toy): test RMSE 3254 → 2432). The renaming is removed.decompose_predictionnames components with the newdecomposition_names(): unique feature names are kept, collisions get a basis prefix (s_x,l_x), and a collision that remains (twote()over the same features) gets an occurrence suffix, so no contribution overwrites another.Plotting helpers after the renaming fix:
plot_effect_with_model_and_dataandplot_effect_with_data_decomposedraisedKeyError: 'effect_x1'for a feature inside ate()or used by several effects. They now resolve the feature to its component: the only one using it, the tensor product whose other margin iscolor_by, or the newcomponent=argument; a still-ambiguous feature raises aValueErrorlisting the candidates. Single-component features plot exactly as before.add_base_effectsin AdaptiveTAM and KalmanTAM: the base model’s components were added asl(effect_<feature>), a name that does not exist when two effects share a feature (s(x) + l(x)giveseffect_s_x,effect_l_x), so the model crashed with aKeyError; and with ate(), the renaming bug above fed mislabelled components. The components are now added under theirdecomposition_names()columns.GCV scored a different penalty from the one it stored (
auto_fit,smart_solve_gcv): each trial rescaled a block that already carried the formula’s own weight, so the search scored λ_formula × λ_GCV but stored λ_GCV alone; a laterfit()on the selected weights returned a different model, and with the defaultap=-9the nine highest decades of the search range were unreachable. Each trial block is now rebuilt by the effect at λ = 10^α, exactly asfit()assembles it; the trial weight is restored even if the search raises, and the initial alphas are clipped to the bounds. Models selected byauto_fitchange.GCV scored a slightly different system from the one fitted (
auto_fit): the solver adds a ridge floor1e-6·n·I, GCV added1e-6·I. Both now use one helper (_ridge_floor), so the selected penalties are scored on the modelfit()returns; a negative residual sum of squares from rounding is clamped at 0 instead of folded withabs(). Penalties belowap = -6are dominated by that floor (documented). Models selected byauto_fitcan change; fixed-penalty fits do not.Trees and RBF centres were initialised on a memory probe, not on the training data (
t(),lt(),rbf()): their data-dependent state was set by the first design matrix built, which is the solver’s size probe (one row per group). With 48 half-hourly groups, quantile splits came from 48 points and thesp_alphaleaf counts summed to 48 × n_trees instead of every training row;rbf()centres were drawn from those 48 points.StaticTAMnow callsinitialize_effects()on the full training tensor before any design matrix; a probe or a later chunk never changes that state. Tree, linear-tree and RBF predictions change for grouped models; ungrouped trees were already initialised on the full data and do not change (ungroupedrbf()changes through its new seed only).rbf()centres were not reproducible: they were drawn from the global torch generator, so an RBF model changed with whatever code ran before it (two identical fits could differ).rbf(x, ..., seed=42)now seeds a local generator, and fitting no longer touches the global random state. RBF predictions change once (new, fixed centres).Sparsity-adaptive tree penalty (
t(..., sp_alpha>0)):empirical_countssummed only the first batch axis, so the leaf-density penalty was built from the wrong counts and could not be formed. It now counts every sample and group, one value per leaf in design-matrix order.Linear tree weight (
lt()): assigninglambda_p(as GCV does on every candidate) did not reach the intercept tree and the slope surface, so GCV could not tunelt(). The weight now propagates to both sub-blocks.Dummy date overflow: without
date_col, the internal dummy date was spaced one day apart and ran past the year 2262 after ~95,000 rows, which overflows pandas 2.x nanosecond datetimes (pandas 3 tolerates it). It is now spaced one second apart.CI: the test workflow runs on every push and pull request (any branch) and on demand, and checks
import tamfirst on every Python version (3.10-3.14).
1.3.0 - 2026-09-06¶
Added¶
Statistics layer (
tam.model.statistics) : a modular “how” beside the structural spectrum “what”, built on the single P-WLS atom (BaseTAM._solve_pwls_step), so the defaultloss="l2"path stays bit-identical to ordinary least squares.Reweighting & estimation (
estimation/): GLM families (Gamma, Poisson, Binomial), asymmetric expectiles, and robust M-estimators (Huber, Student-t) viaStaticTAM(loss=...), driven by an IRLS schedule over the atom.Distributional location-scale fits via a dict formula/loss (
{"mu": ..., "sigma": ...}), with automatic Normal/Student-t tail selection,predict_quantiles,cdf,anomaly_scoreandcrps.Mixture of TAM regressions (
mixture_components=K) fitted by EM whose M-step is the responsibility-weighted atom.Gaussian copula (
GaussianCopulaTAM) binding several distributional margins.Conformal & ACI (
statistics.risk): distribution-free CQR intervals, conformal p-values, Mondrian (stratified) calibration (ConformalDistributionalTAM) and streaming Adaptive Conformal Inference, on the staticSafetyTAMengine.EVT & epistemic uncertainty: Generalized-Pareto tail scoring (
GeneralizedParetoTail,fit_gpd_tail) and Bayesian posterior parameter uncertainty (posterior_prediction).
1.2.6 - 2026-07-17¶
Added¶
Added SPDX license identifiers (
LGPL-3.0-or-later) and standardized file headers with proper authorship and copyright attribution across the entire codebase (2026-07-01).
Changed¶
Major Data Upgrade: Replaced the legacy
dataset_national.csvwith the new FORCE (French Open Research Catalogue of Energy) dataset. The library now defaults to this high-performance, harmonized dataset for baseline benchmarking and examples.
Fixed¶
Critical Tensor Alignment Bug (
group_col): Fixed an order-sensitivity vulnerability in the tensor stacking and DataFrame reassembly layers. The framework now enforces strict chronological sorting (viadate_col) before building 3D tensors, preventing penalty matrix corruption on non-sequential data. Additionally, it now safely maps chronological PyTorch predictions back to shuffled Pandas indices, guaranteeing row-to-row integrity.
1.2.5 - 2026-06-24¶
Added¶
Topological Split Strategies (
TreeEffect): Formalized thesplit_strategyparameter. Users can now explicitly toggle between'uniform'(creating mathematically orthogonal, shift-invariant Cartesian grids) and'quantile'(applying the empirical Probability Integral Transform to create density-adaptive partitions that perfectly balance sample distributions across all leaves).
Changed¶
Empirical Sparsity-Adaptive Penalty (Anisotropic Ridge): Upgraded the structural penalty of the Random Forest (
t(...)) and Linear Tree (lt(...)) modules. By settingsp_alpha > 0, the initialization pass now accurately records the empirical data density of each terminal leaf (\(C_i\)).Drift & Singularity Prevention: Starved or empty edge-boundary leaves now receive geometrically massive penalties. This guarantees global matrix rank, eliminates the catastrophic test drift associated with hard Cartesian grids, and theoretically resolves the OLS singularities traditionally found in Model-Based Recursive Partitioning (MOB).
1.2.4 - 2026-06-22¶
Added¶
API Standardization: Introduced explicit
fit()andpredict()methods across all meta-models (AdaptiveTAM,OperaTAM,KalmanTAM). This establishes a unified, scikit-learn-like operational workflow (train on historical data, freeze state, predict out-of-sample) regardless of the underlying algorithm.AdaptiveTAM: Added
fit()andpredict()methods for production deployment. Thefit()method efficiently extracts and solves the linear system strictly for the final available training window. Thepredict()method then applies this frozen state (last_state_dict_) to new data in \(O(1)\) time with strict safety clipping, ensuring instant, deterministic inference without target leakage.KalmanTAM: Added
fit()andpredict()methods alongside end-of-training state extraction (last_state_dict_andscale_dict_). This allows users to project the finalized Kalman drift weights forward as a stable, static rule on new data, with the internal normalization math handled automatically.OperaTAM: Added
fit()andpredict()methods to transition from continuous dynamic simulation to frozen-weight inference.fit()runs the historical simulation, whilepredict()cleanly extracts and applies the final expert aggregation weights to new out-of-sample data.
Fixed¶
StaticTAM: Removed the
target_colrequirement from the required features check indecompose_prediction. This resolves a critical blocker for operational inference pipelines where the target variable is naturally unavailable.KalmanTAM: Patched
_prepare_kalman_featuresto securely bypass target column extraction during out-of-sample inference, preventing crashes when the target variable is absent.
1.2.3 - 2026-06-08¶
The DOI was generated via Zenodo on release : https://doi.org/10.5281/zenodo.20543272.
Added¶
Universal Extrapolation Wrapper: Introduced native Out-Of-Distribution (OOD) extrapolation for all base effects via the
extrapolateparameter. It safely bounds the feature map to the \([-1, 1]^F\) hypercube and utilizes multidimensional directional derivatives (stepping strictly backward into the safe zone) for OOD inputs. Supported modes includecontinue(native topology),constant(plateau/clamping),linear(first-order Taylor expansion), andsaturation(smooth asymptotic clamping).Linear Tree (
lt(...)): Added a native effect that generates piecewise linear models. It utilizes a dedicatedLinearTreeEffectclass to encapsulate a standardTreeEffect(acting as the local intercept/level) crossed with aTensorProductEffect(acting as the local linear slope). This provides a single, cohesive model for varying-coefficient trees, seamlessly handling multi-dimensional spatial data without requiring formula macro workarounds.Flat N-ary Histograms (
TreeEffect): Added themax_leavesparameter to bypass binary depth and force flat 1D N-ary splits. This includes an Anti-Starvation Protocol (evenly spaced bins) for single trees to guarantee full matrix rank and prevent over-complete matrix singularities in piecewise regressions.Academic Reproductions: Added official benchmark scripts reproducing foundational load forecasting architectures using the TAM framework:
2011_pierrot_goude.py: Benchmarks native grouping vs. PyGAM manual loops using local B-splines.2025_doumeche_et_al.py: Benchmarks the transition from local splines to global Fourier bases with Sobolev regularization.
Theory, Cheatsheets and Documentation: Added comprehensive TAM documentation:
THEORY as the central mathematical reference and
cheatsheet.pyto showcase the entire TAM spectrum (Static bases, Neural Networks, Physics operators) wrapped in Meta-Learners.The StaticTAM
The Primal Model: Theory | Architecture
Tensorization & Data: Theory | Architecture
Linear Systems: Theory | Architecture
Complexity & Hardware: Theory | Architecture
GCV & Auto-ML: Theory | Architecture
The base effects : Linear / Fourier / Spline / Chebyshev / Categorical / Interaction / RBF / Neural / Tree / Linear Tree / Wavelet / PID / Physics
The AdaptiveTAM
Adaptive Online Learning: Theory | Architecture
The OperaTAM
Expert Aggregation (Opera): Theory | Architecture
Changed¶
OPERA Dual API Support (
OperaTAM): Added a standard array-based initialization (target_col="y",expert_cols=["E1", "E2"]) alongside the existing R-like formula API (formula="y ~ l(E1) + l(E2)"), allowing for simpler dynamic aggregation.Architectural Shape Normalization: Overhauled
build_feature_mapacrossTreeEffect,NeuralEffect, andRBFEffect. Added a dynamic dimensional router to natively resolve tensor broadcasting ambiguities across 1D (OOD wrappers), 2D (Kroneckerte(...)interactions), and 3D+ (Primal Solver Factory) inputs.Formula Parser Robustness: Upgraded
parse_formula_to_termsto explicitly track and uniquely index nested sub-arguments using positional indices (i,j). Resolves parameter collision and overwriting issues when parsing nested interaction terms containing identical effect types.Memory Probe Safeguards (Dummy Pass): Improved robustness of the VRAM footprint estimation during the dummy pass across all base effects. This prevents premature initialization of randomized partition geometries, NEPT weights, or RBF centers during the framework’s memory estimation phase.
Categorical Effect Automation: The Categorical effect (
c(...)) now automatically parses the dataset to countn_catif the parameter is omitted by the user.MLOps Dashboard (
plotting_dashboard):Enhanced chronological forecast plots with a
forecast_smoothingparameter (supports rolling averages and date-based resampling).Implemented dynamic evaluation metrics for the Test Set Vulnerability heatmap (automatically scaling for RMSE, MAE, MAPE, etc.).
Unified color mapping across all subplots ensuring consistent model identification using Matplotlib’s
tab10colormap.
[Internal] 1.2.2 - 2026-03-26 (Not publicly released)¶
Added¶
Evolutionary Orchestrator (
AutoTAM): A multi-fidelity AutoML engine for automated GAM discovery. It utilizes a Hub-and-Spoke evolutionary architecture, strict topological sanitization, and bi-level optimization (GPU MSP-GCV) to solve the combinatorial explosion of adaptive models, ultimately deploying orthogonal experts into a Dual OPERA arena.OPERA (
OperaTAM): A new expert aggregation meta-learner featuring a fast GPU implementation natively optimized via@torch.jit.script.Kalman Filter (
KalmanTAM): Dynamically tracks coefficient drift over time via a Fast Dynamic Extended Kalman Filter (EKF), highly optimized using the Woodbury matrix identity (reducing inversion complexity to \(\mathcal{O}(T_{block}^3)\)) and compiled withTorchScript.DeepGAM (
NeuralTAM): A new Deep-GAM hybrid model (Additive + Deep Learning) implementing Group-wise Orthogonal Backfitting.Tree Effect (
TreeEffect): Added the Tree / Random Forest effect (t(...)) designed for GPU, based on Oblivious Random Trees and Random Binning Features approximation.Hardware Manager (
HardwareManager): Centralized hardware abstraction layer to dynamically manage the capabilities of different compute backends._dispatcher.py(Mathematical Solver Dispatcher): Created an intelligent routing layer between statistical modeling abstractions and PyTorch linear algebra engines. It dynamically routes resolution to either a chunked direct solver or a Matrix-Free Sparse Conjugate Gradient (CG) solver based on topological complexity and available VRAM._memory.py(Hardware Memory Management and Estimation): Completely isolated low-level hardware interactions into a dedicated module. It estimates the byte footprint of massive matrices and calculates safe algorithmic chunk sizes.
Changed¶
Neural Effect Improvements (
NeuralEffect): Added support for multiple hidden layers to project variables into higher dimensions.Native GPU Acceleration: Complete migration of intensive CPU to GPU calculation for Splines (
s(...)), Wavelets (w(...)), and RBF (rbf(...)) effects, improving performance of design matrix construction.Memory Management (Safeguards & Smart Chunking):
Overhauled memory safety to prevent and correct CUDA Out of Memory bugs via a smart chunking system.
Implemented a memory safeguard for CPU / group-chunking by independent series.
Established strict dynamic RAM & VRAM safety margins to guarantee the stability of large matrix inversion operations.
[Internal] 1.2.1 - 2025-12-18 (Not publicly released)¶
This version represents a complete architectural overhaul, introducing advanced functional bases (Spectrum), Conformal Prediction, and a full benchmark suite.
Added¶
Auto-ML (GCV): Added
StaticTAM.auto_fit()using Generalized Cross Validation (GCV) for automatic global regularization parameter selection, eliminating the need for a validation set.Safety Module (Conformal Prediction): Added
SafetyTAMimplementing Split Conformal (static) and Adaptive Conformal Inference (ACI) (dynamic) to guarantee valid confidence intervals under distribution shift.Hierarchical Reconciliation: Added
HierarchicalTAMto solve global constraints (e.g., National = Sum of Regions) via joint optimization on the primal system.Model Introspection: Added
StaticTAM.summary()to display the model’s structure, complexity, and regularization parameters.Core Effects Library (
spectrum): Implemented a complete modular library of advanced functional bases:ChebyshevEffect(p(...)): Global polynomials for stable trend approximation.WaveletEffect(w(...)): Ricker wavelets for local anomaly and transient feature detection.NeuralEffect(n(...)): Neural projection for high-dimensional non-linearity.RBFEffect(rbf(...)): Support for both Gaussian and Matérn (physics-informed) kernels.TensorProductEffect(te(...)): Multivariate interactions (Kronecker product) for surface modeling.UniversalPhysicsEffect(phys(...)): PIKL (Physics-Informed Kernel Learning) for constraining models with differential operators (ODEs/PDEs).
Changed¶
Math Engine (Primal Solver): Formally validated the exact Primal Ridge Solver utilizing block-diagonal covariance accumulation. Corrected performance tracking to accurately reflect the framework’s time complexity of \(\mathcal{O}(G \times T \times D^2 + G \times D^3)\), ensuring isolated mathematical resolution per group \(G\).
Effect Architecture: Refactored the core around
BaseEffect, establishing theList[BaseEffect]as the standard configuration.Modularization: Monolithic
_effects.pywas entirely split into thespectrumpackage, improving modularity.Normalization Domain: Changed global feature normalization from the Fourier-centric \([-\pi, \pi]\) to the strictly orthogonal \([-1, 1]\) domain in
_data.py. Basis functions now apply internal scaling (e.g., Fourier rescales to \([-\pi, \pi]\)).Decomposition Robustness: Implemented collision detection in
_math.pyto automatically prefix feature effects (e.g.,l_time,s_time) when multiple bases share the same input variable.
Fixed¶
Recursive Parsing: Implemented an architectural fix in
parse_formula_to_termsto correctly identify and preserve string tokens (likega_teorgrid_k) during the recursive parsing ofte(...)terms.Syntax Stability: Converted all docstrings containing LaTeX math commands to raw strings (
r"""...""") to eliminate PythonSyntaxWarnings.
[Internal] 1.1.1 - 2025-11-21 (Not publicly released)¶
This version introduced the Formula API and the first object-oriented refactoring.
Breaking Changes¶
Removed legacy dictionary-based API (
m_orders,s_orders,alpha_list)Introduced formula-based API as the primary interface
Added¶
Formula-based API (
model/additive.py): Implemented a new, intuitive R-like formula API (e.g.,Load ~ s(temp, k=10) + l(day_type)) as the new standard for model initialization.Spline Effects (
model/_effects.py): AddedSplineEffect(P-splines) as a new core effect type, available vias(...).Formula Parser (
common/utils.py): Added aparse_formula_to_termsfunction to support the new API.StaticTAM&AdaptiveTAM: Implemented the full object-oriented API (.fit(),.predict()) and the online error correction model.Multi-Start Grid Search: The
grid_search_fitmethod now uses a Multi-Start Coordinate Descent strategy (Conservative, Median, Aggressive) to avoid local minima.diagnosticsModule: Added a module for model analysis, including t-tests and feature importance visualization.
Changed¶
Legacy API Removed: Removed the old
m_orders,s_orders,alpha_listdictionary-based configuration fromv0.0.6.Package Structure: The codebase was refactored into a modular package structure (
common,model).Internal Math: Math functions (
_math.py) were cleaned of all effect-specific logic and made robust to 2D/3D tensor inputs.Hardcoded Names Removed: Removed dependencies on specific column names (
tod,timestamp,Load).
0.0.6 - 2025-05-27¶
Added¶
Initial project setup based on the original
weaklv0.0.6 package.