Changelog¶
1.16.1 — 2026-11-28¶
- Made
Pipeline.runthe one call for testing a model. Its result now carries the scorecard:result = pipeline.run(), thenresult.scorecard.plot()orprint(result.scorecard), withresult.assert_passed(),result.save(path)andresult.checksread straight from its report. With no argumentsrun()draws the scorecard's ten kinds of series at low and high noise, 10 times each (200 series), and it takes the scorecard's settings:noise_levels,history_length,horizon,simulate_attainableandinterval_level. Scenarios you built give one row each. A run of your own data (cases=) has no scorecard, since nobody knows its answer key, and readingresult.scorecardsays so and points toresult.checksand the errors inresult.metrics. run()now drops the series and forecasts once each one is measured, so a large run stays small in memory. The report, the scorecard with its picture,save_baseline,compareandplot_errors()work as before;keep_data=Truekeeps every series and forecast forplot_forecasts(),result.calibration()and your own reading, andresult.kept_datasays which. Code that readresult.cases[i].caseor.forecastneedskeep_data=True. With nothing to forecast named,run()used to draw the five kinds ofdefault_scenarios()3 times each; it now draws the scorecard's series, and with scenarios named it draws each 10 times instead of 3.Pipeline.test(...)andPipeline.scorecard(...)still work as before and now warn: usepipeline.run(...)andpipeline.run(...).scorecard. They will be removed in a later release.timegym.scorecard.scorecardwarns the same way, and the scorecard's closing line now saysRun pipeline.run(instances=30) to narrow them.-
Moved the README, the docs, tutorials, source notebooks, examples, the paper's sentence on the scorecard call, the script that draws the README's pictures and the installed-package check to the new call.
-
One word for the past a forecaster sees: history. Write
fit(self, history)in your models,Scenario(kind, history_length=120, horizon=12),task.history,pipeline.predict(history, future_index),mase(observed, predicted, history),rmsse(observed, predicted, history),check_shift_equivariance(pipeline, history, future_index)andhistory_length=inrun(),scenario_gridanddefault_scenarios. A metric or a check of your own asks for the past by naming its argumenthistory. The built-in models and target transforms name their argumenthistorytoo, the built-in baselines keep what they fitted ashistory_, and error messages say history where they said context. - The old names still work and warn, and will be removed in a later release:
context_length=wherever it was taken (Scenario,Pipeline.scorecard,scenario_grid,default_scenarios,generate_process,generate_joint_process,resolve_processandtimegym.scorecard.scorecard),scenario.context_length,ForecastTask(context=...),task.context,context=inPipeline.predict,mase,rmsse,check_shift_equivariance,fitof the built-in models andfit_transformof the built-in target transforms,context_on the built-in baselines, a metric or a check whose argument is namedcontext(it warns once per run), and abuildof your own whose scenario hascontext_lengthinstead ofhistory_length. A model of your own writtenfit(self, context)needs no change, since TimeGym passes the history by position. - New cases, reports and scorecard baselines record
history_lengthwhere they recordedcontext_length. Reports and baselines saved by 1.14.1 and earlier still load, compare with new ones and replay. Code that readscase.manifest["context_length"]from a new case needscase.manifest["history_length"]: that is the one change that does not warn. Scorecard baselines are now format version 2, so TimeGym 1.14.1 refuses a new baseline and asks to be upgraded instead of failing on the missing key; the report format is unchanged. -
Moved the docs, the glossary (History, where it said Context), the README, tutorials, examples, source notebooks, the installed-package check and the paper to the word history wherever they meant the past a forecaster sees.
-
One class for each built-in baseline, named for the forecast it makes:
LastValueForecaster(),SeasonalLastValueForecaster(period)(seasonal naive: each step gets the last value seen at the same point of the cycle),MeanForecaster(),SeasonalMeanForecaster(period)andDriftForecaster(), all fromtimegym. Only the two seasonal ones take aperiod. Reports and scorecards name each by its class, and each replays from a report. NaiveForecaster(strategy, period)still works, makes the same forecasts as before and now warns, naming the class that makes the same forecasts for the strategy given, such asSeasonalLastValueForecaster(period=12); it will be removed in a later release. A pipeline warns once, not once per case. Reports and scorecard baselines that nameNaiveForecasterstill load, compare and replay, and replaying one does not warn.LastValueForecasteris still aNaiveForecaster, as before.-
Moved the docs, tutorials, examples, source notebooks and the installed-package check to the new classes.
-
Pipelinetakes the model to test first, in one of four forms: a model (anything withfitandpredict, copied fresh for every case, even if it can also be called); a list of scikit-learn steps ending in a regressor, such asPipeline([StandardScaler(), Ridge()], window_length=24), which becomes one scikit-learn pipeline (a scikit-learn pipeline you already have is taken as it is); a class; or a function that returns a fresh model, now writtenPipeline(make_model)and called for every case, asPattern(attainable_by=...)calls it. A list that does not end in a regressor is refused when the pipeline is made. - Reports, comparisons and the scorecard title name a scikit-learn pipeline by its steps, such as "StandardScaler + Ridge". It is described in the report and not replayed from it, like other models of your own.
.add(),model_factory=and a pipeline with no model still work as before and now warn: use the list of steps, which makes the same forecasts,Pipeline(make_model), andPipeline(LastValueForecaster()), which makes the forecasts a pipeline with no model makes..add()warns once per pipeline and a pipeline with no model warns when it is first used. They will be removed in a later release.-
Moved the docs, tutorials and source notebooks to the list of steps and to a model in every pipeline. The scripts behind the paper's scorecard figure and the follow-up study keep their
.add()chain, which the figure's title and the study's registered protocol name. -
Pipeline(model, ..., name="Forest")names the model once for everything a run shows: the scorecard's title, a heading aboveplot_forecasts()andplot_errors(), its label incompare_reports, andresult.metadata["name"], whileresult.metadata["model"]still names the class.compare_reports([a, b], c, metric="mae")labels a list of reports by their names, or by their models when they have none; a dictionary of named reports works as before. The name is saved with the pipeline's configuration, so replay keeps it. Without a name, titles, plots and reports stay as they were. ForecastRun.from_forecasts(cases, forecasts, name="weather service")names recorded forecasts the same way. Naming them withmetadata={"model": ...}still works and now warns; it will be removed in a later release.Pipeline.scorecard(title=...)andtimegym.scorecard.scorecard(title=...)keep theirtitlewhile they warn.-
Moved the docs, examples and source notebooks to
name=. -
metrics=is the one name for the numbers a run records for each case:pipeline.run(cases=cases, metrics=["brier", "log_loss"]), and the same inForecastRun.from_forecasts,timegym.diagnostics.evaluate_forecastandPipeline.test. They are read back in each case'smetrics, and chosen withmetric=and imported fromtimegym.metricsas before. New reports list what was asked for undermetadata["metrics"]. scores=still works on each of these calls and warns; it will be removed in a later release. Passing both is refused. Reports saved by 1.14.1 and earlier list the metrics asked for undermetadata["scores"]; they still load, compare and replay them.- In the docs and docstrings, a score is now only the scorecard's number from 0 to 100; the numbers recorded for each case are metrics. The page "Scores and diagnostics" is now "Metrics and diagnostics", at the same address, and its section "Your own scores" is "Your own metrics". Error messages say metric where they said score; the messages a report saves for a case keep their words, so older reports replay exactly.
-
Moved the docs, examples, source notebooks and tests to
metrics=. -
Every case with an answer key now records
avoidable_msewhere it recordedmean_reference_mse: the same number, the squared distance from the forecast to the answer key, which is the part of the error the model could have avoided. It is the number the scorecard's table callsavoidable_mse, averaged there over a cell's series, andresult.plot_errors()draws it by default. - Its old name still works and warns:
case.metrics["mean_reference_mse"](also with.getandin) andmetric="mean_reference_mse"inplot_errorsandcompare_reports. It will be removed in a later release. Reports saved by 1.14.1 and earlier load with the new name, in each case's metrics and in thepoint_accuracyevidence, so they compare and replay with new ones. The functiontimegym.metrics.mean_reference_mse, which computes it, keeps its name. - The columns
avoidableandbaseline_avoidableof a scorecard comparison'stable(card.compare(baseline)) are nowavoidable_mseandbaseline_avoidable_mse. A table column cannot warn, so code that reads the old columns needs the new names. Saved scorecard baselines keep their format and still compare. -
Moved the docs, tutorials, examples, source notebooks and tests to
avoidable_mse. The study records underexperiments/keepmean_reference_mse; the scripts that read them accept both names. -
Added
timegym.checks.dependence(n_calibration=99, alpha=0.05), the check that the forecast samples spread together the way the answer key does, asked for like any other check:pipeline.run(scenarios, checks=[dependence()]). It runs the same check, with the same seeds, ascheck_dependence=Truedid, gives the same findings and the samedependencerow inresult.checks, and works the same way inForecastRun.from_forecasts,timegym.diagnostics.evaluate_forecastandPipeline.test. check_dependence=,n_calibration=,alpha=anddependence_seed_offset=still work onrun(),from_forecasts()andPipeline.test(), as do the first three onevaluate_forecast(), and warn; they will be removed in a later release.run()no longer lists them in its signature. Passing them besidedependence()is refused. Withdependence()the check's draws are seeded 100000 after the case's, the old default.dependence_seed_offsethas no new form: any offset gives an equally good check, since it only keeps the check's draws apart from the case's.- Reports record the check's settings under
diagnostic_settingsas before, so reports saved with either form, or by 1.14.1 and earlier, compare and replay the same way. -
Moved the docs, tutorials, source notebooks, tests and experiment scripts to
checks=[dependence()]. -
Each entry of
result.casesnow reads its case's parts directly:entry.history,entry.future_index,entry.observed,entry.reference,entry.forecast,entry.metrics,entry.diagnosticsandentry.manifest. The last three are the case's entry in the report, the same record asresult.report.cases[i], so a case's kind and seed areentry.manifest["kind"]andentry.manifest["seed"]. In a run that drops its data, the default, the series, the answer key and the forecast are None, and the metrics, diagnostics and manifest stay.entry.caseis still the wholeCase, to hand to another call. entry.resultstill works and now warns; it will be removed in a later release.EvaluatedCase(case, forecast, result, scenario_index, seed_index)is made as before.-
Moved the docs, tutorials, examples, source notebooks, tests, the plots, the scorecard and the paper's scorecard figure to the entry's parts.
-
Added
result.metrics, every case's metrics in one pandas table:result.metrics["mae"]orresult.metrics.groupby(["pattern", "noise"])["mae"].mean(). It has one row per case, in order, labelled by the case's position. The case's labels come first and tell the scenarios apart: on the scorecard's kinds of series itspatternandnoise, the scorecard's row and column, and itsseed; for scenarios you built itsscenario, the name of its row on the scorecard ("ar1", then"ar1 (2)"for a second of that kind), and itsseed; for cases cut from your own data itskindandorigin. Then one column per metric, in alphabetical order. A run records its scenarios' labels inresult.metadata["scenario_labels"], so a saved report keeps them; one saved by an earlier release is labelled bykindandseed. A case that crashed or failed an output check is not scored, so its metrics are NaN, as incompare_reportsand the scorecard. It reads only the metrics, so it works in a run that dropped its data, andreport.metricsgives the same table on aTestReport, including one read back from its file. The table is made each time it is read. -
Moved the examples, tutorials and source notebooks that built these tables by hand to
result.metrics, and showed it on the Pipeline and reports page. -
Added
result.compare(baseline, *, metric, by=None, cluster=None, alpha=0.05, higher_is_better=False, seed=0)to a run and to aTestReport.candidate.compare(baseline, metric="mae")iscompare_reports(candidate, baseline, metric="mae"): the same settings and the sameReportComparison.compare_reportsstays, without a warning, to compare several candidates with one baseline at once. -
Moved the docs, the README, the source notebooks and the tests that compare one candidate to
result.compare. The metrics page shows the method for one candidate andcompare_reportsfor several. -
Added
result.save(path)andreport.save(path), which write the report to a JSON file and returnpath, andTestReport.load(path), which reads it back.to_json()with no path returns the text, as before, andTestReport.from_json(text)reads text. report.to_json(path)andTestReport.read(path)still work and now warn; they will be removed in a later release. Saved reports load as before.card.save(path), which saves the scorecard's picture, andcard.save_baseline(path)are unchanged.-
Moved the docs, the README, the tutorials, the source notebooks, the tests,
examples/reproduce_report.pyand the installed-package check tosaveandload. -
The scorecard's switch that simulates a missing attainable score is now
simulate_attainable=True, as inpipeline.run(noise_levels=3, simulate_attainable=True). It simulates the score of a row that has none stored, off the default grid or a pattern of your own withattainable_by; the default grid shows its stored values either way.pipeline.scorecard(attainable=True)andtimegym.scorecard.scorecard(attainable=True)still work and now warn; they will be removed in a later release. -
Moved the docs, the examples, the source notebooks and the tests to
simulate_attainable=True. -
Added
result.calibration(*, bins=10, cluster=None, interval_level=0.95, seed=0)to a run:result.calibration()istimegym.diagnostics.calibration(result), read off the result like the scorecard, on a run that keeps its data (keep_data=True). The confidence of the slope's interval is nowinterval_level=intimegym.diagnostics.calibrationtoo, the scorecard's word for the same idea, where 1.14.1 saidlevel=, and theCalibrationit returns records it asinterval_level, where 1.14.1 called itlevel. calibration(..., level=0.95),Calibration.levelandCalibration(..., level=...), as 1.14.1 wrote them, still work and now warn; they will be removed in a later release. Passing bothlevel=andinterval_level=is refused.result.calibration(level=...)works and warns the same way.-
Moved the docs, the README and the source notebooks to
result.calibration(). -
Every deprecation warning now says that the old name "will be removed in a later release". The older ones, such as those for
get_stock,generate_processandPipeline.plot_tests, said "in TimeGym 2.0"; a warnings filter that matched those words needs the new ones.
1.14.1 — 2026-11-24¶
- Added
timegym.diagnostics.calibration(run, *, bins=10, cluster=None, level=0.95, seed=0), which asks whether forecasts of a yes/no outcome come true as often as they say: of the days given a 70% chance of rain, did it rain on about 70%? It reads a run's point forecasts, or the mean of the sample paths, or arrays withcalibration(observed, predicted), and returns aCalibration: atableof bins of equal width with the number of forecasts, their mean and the share that happened; the calibrationslope(1 is calibrated, below 1 too confident, above 1 too timid) with a bootstrapslope_intervalthat resamples whole cases, or whole clusters withcluster=; the calibrationintercept(0 is right on average); andplot(), a reliability diagram drawn by the newtimegym.plotting.plot_calibration. Forecasts of exactly 0 or 1 are counted incertain, since the slope reads them as 0.000001 and 0.999999. Nothing else changes. - Added a section on calibration to the scores page, a sentence on the scope page and in the README, and a section to the scores notebook with twenty weather stations, where a share learned from few cycles says 0% or 100% too often and adding one rainy and one dry step to each count fixes it.
- Added a sentence to the Pipeline page saying that
scorecard(patterns=...)takes your ownPatternobjects beside the keys ofPATTERNS.
1.13.1 — 2026-11-24¶
- Added your own kinds of series to the scorecard.
Patternis now exported fromtimegym, andPipeline.scorecard(patterns=...)andscenario_gridtake your ownPatternobjects beside the keys ofPATTERNS: a title, the sentences saying what is predictable and what is not, andsimulate(rng, history, horizon, noise), a function that draws one series and returns itsvalueswith the truemeanandvarianceof each step to forecast (and optionally acovariance). TimeGym cuts the history from the future and builds the case and its answer key. A kind of series that needs more can givebuild(noise, context_length, horizon)instead, returning an object that generates whole cases. Before anything runs, the grid draws one case per cell and says what is missing or has the wrong shape, or that a key belongs to a built-in pattern. Withattainable_by=andattainable=True, the row's attainable score is simulated as for the built-in rows; otherwise it is NaN. The table,save_baselineandcompareknow the row by its key.GridCellhas a new fielddefinition, thePatternthe row comes from. Built-in rows are unchanged. - Renamed
Pattern.fittedtoPattern.attainable_by, which takes the row's own model itself (copied fresh for each series) as well as a class or function that returns one. The built-in rows hold their models, soPipeline(PATTERNS["trend"].attainable_by)scores one.fitted=andPattern.fitted()still work and warn that the name changed. - Added
NaiveForecaster("seasonal_mean", period=...): each step forecast with the mean of all past values at the same point of the cycle, which for yes/no values is the share that happened there. - Added a section on your own kinds of series to the scorecard page, with a yes/no row (rain or no rain, with a chance that follows a cycle) where the score becomes the share of the expected Brier score that no forecaster could avoid, a row on the Extend TimeGym page, and a section to the scorecard notebook.
1.12.1 — 2026-11-23¶
- Added an Examples section to the documentation, placed right after the home
page: forecasting jobs on real public data, from the first model to a
decision, with TimeGym in the loop. The first twenty-two are weekly shop
sales turned into stock orders, spare parts where the lowest average error
goes to a forecast of zero, a Christmas order that five Decembers cannot
settle and generated shops can, a call center's forecast made again at ten
o'clock, train station riders forecast with the real weather to see what a
weather feed could add, daily births forecast with different amounts of
history, a day-ahead electricity forecast improved by asking which days went
wrong, a range for a solar farm's whole day that half-hour ranges cannot
give, a 90% range for a river's flow, rain tomorrow scored against the
weather service's own forecast, Sydney's temperature forecast with other
cities' help, London's air scored only where it was measured, a flu season
forecast from the calendar of earlier winters, which works until the peak
comes late, the sunspot cycle split by years ahead, an El Niño forecast whose
reach depends on the month it is made, a jump in a page's traffic where the
ordinary backtest picks the wrong forecaster, a site's capacity booked four
weeks ahead and tested at that lead time, a Bitcoin backtest whose edge was
one input reaching into the future, a range for the S&P 500's next week that
holds in crashes, a random forest that cannot follow growing airline traffic,
the winner of a 50-setting backtest that comes tenth the next year, and a
pretrained model whose bad backtest year comes down to five products. The
notebooks are in
examples/, with a small sample of each dataset committed inexamples/databeside its source, license and credit, so they run offline. The pretrained model's forecasts were made once and are saved inexamples/forecasts.examples/example_data.pyloads the samples and, withload(name, full=True), downloads and checks the whole dataset.pip install -e '.[examples]'from a clone installs what the notebooks need. - Added ways to score your own data.
timegym.cases_from_series(series, origins, horizon, *, name="series", manifest=None)cuts a series, or a table of series, into cases that end their history at different times: an origin is a number of rows, a share of the rows, or an index label. Each case keeps the rows after its origin as what happened, has no answer key, and records in its manifest where its history ends and a fingerprint of the whole series.Pipeline.testandPipeline.runtake these, or any list ofCaseobjects, ascases=[...], with a fresh model for every case.ForecastRun.from_forecasts(cases, forecasts)checks and scores forecasts made earlier, without a model, and gives a run with the usual report and plots. - Changed
evaluate_forecastto accept a case whose manifest has nokindorseed, as your own cases may: it is labelled"case"with no seed. A manifest written by a TimeGym scenario must still have both. - Changed replay to say why it cannot replay a case that was not drawn from a
TimeGym scenario, or a report with no pipeline configuration, such as one
from
ForecastRun.from_forecasts. - Changed the forecast plots to name a case with no seed by where its history
ends, and the error messages of
plot_errorsto sayseed 2rather thanseed=2. - Added a section on your own data to the scope page, a recipe on the data
preparation page for putting readings taken at irregular times on a regular
grid without looking ahead, and a page, Extend TimeGym, that lists every
place to plug in your own code and data. Tutorial 07 now builds its cases
with
cases_from_seriesand scores them withpipeline.run(cases=...). - Added scores for forecasts of yes/no outcomes, such as rain or no rain:
timegym.metrics.brier(observed, predicted), the mean squared gap between the forecast chance and what happened (0 or 1), andlog_loss(observed, predicted, *, eps=None), which punishes a confident wrong forecast hard. A forecast of exactly 0 or 1 that turns out wrong makes the log loss infinite, solog_lossraisesUndefinedMetricErrornaming its position unless you passeps, such aseps=1e-6, to clip forecasts first. Both refuse observations other than 0 and 1 and chances outside [0, 1]. - Added four scores to
timegym.metrics:rmse, the root mean squared error;rmsse(observed, predicted, context, seasonality=1), the root mean squared error divided by that of repeating the value one season back in the history;interval_score(observed, quantiles, levels), the width of the widest symmetric interval plus a penalty for each value outside it; andweighted_interval_score(observed, quantiles, levels), the mean of interval scores over every symmetric pair of levels and the median, which needs 0.5 among the levels. MAPE and sMAPE are left out on purpose: they blow up near zero and treat over- and under-forecasts unevenly. - Added
scores=toevaluate_forecast,Pipeline.test,Pipeline.runandForecastRun.from_forecasts, to record scores beyond the usual ones. Give a list of names fromtimegym.metricsand functions of your own, or a dictionary that names each, for example to pass settings withfunctools.partial. A function says what it needs by its argument names:observed,predicted,quantiles,levels,samplesandcontext. Each value lands incase.metricsunder its name. A request that cannot work, such as an unknown name, a name every report records already, or an argument TimeGym cannot give, is refused before anything runs. For each case, a score whose input the forecast lacks gives ametric_<name>diagnostic markedUNSUPPORTED, and one that raises givesERRORwith the exception named. With noscores=, reports are unchanged. - Changed replay to compute again the requested scores from
timegym.metrics, with their settings, which the run records undermetadata["scores"]. Your own functions cannot be rebuilt from a saved report, so replay leaves them out of the comparison and lists them under"not_recomputed". - Added the new scores and
scores=to the scores page and the Extend TimeGym page, and a section to the scores notebook that scores two forecasts of rain or no rain with the Brier score and the log loss. - Added
timegym.compare_reports(candidate, baseline, *, metric, by=None, cluster=None, alpha=0.05, higher_is_better=False, seed=0), to say whether a forecaster is better or worse than another on the same cases, or shows no clear difference. It pairs the two reports case by case, refuses reports whose case manifests differ, and returns aReportComparisonwithtable,better,worse,too_few,assert_no_regression()and a printed summary.bynames a manifest key and gives one row per group, with Holm's correction across groups.clusternames a manifest key whose cases move together, such as the store a case was cut from; those cases count as one piece of evidence. A row where too few cases or clusters differ for any difference to reachalphasays "too few to tell" and failsassert_no_regression(). A case the baseline scored that crashes or fails an output check in the candidate makes its row worse.candidatemay be a list or a dictionary of reports: each candidate's p-value is then adjusted for every candidate and group tried, so the best of many does not beat the baseline by luck. The test is a two-sided paired sign-flip test. - Changed where the sign flips and Holm's correction behind
Scorecard.comparelive:timegym.diagnostics, shared withcompare_reports.Scorecard.comparekeeps its one-sided question, and its results are unchanged. - Added a section on comparing two forecasters to the scores page, a sentence pointing to it on the scope page, and a section to the scores notebook that compares two forecasters of store sales by region and measures how often cases that move together, and the best of many variants, give a false verdict.
- Added
checks=toevaluate_forecast,Pipeline.test,Pipeline.runandForecastRun.from_forecasts, for output checks of your own, andtimegym.checks.within(lower=None, upper=None), a ready-made range check:within(0, None)for rainfall or sales,within(0, 1)for a chance. It reads the point forecast, the quantiles and the samples;Noneleaves a side open, and a dictionary from series name to bound gives each series its own range. Your own check is a function that asks for its inputs by argument name, as a score does, plustarget_names, and returnsTrueor a message saying what is wrong; its title is the first line of its docstring. A failed check is aFAILnamedcheck_<name>, is counted inreport.checksafter the built-in checks and makesassert_passedraise. Each finding keeps the check's title, so a saved report loads without your code; the run records the checks undermetadata["checks"]. Replay runswithinagain and lists your own functions under"checks_not_rerun". Withoutchecks=, reports are unchanged. -
Added a section on your own output checks to the scores page and the Extend TimeGym page, a catalogue entry for
check_<name>, a sentence in the README, and a section to the scores notebook that checks forecasts of store sales for values below zero and for totals that don't add up. -
Added a confidence interval to every scorecard score.
card.tablehas new columnsscore_lowandscore_high, andsettled, True when both ends fall in the score's band;card.unsettledlists the rows that are not settled. With other series of the same kind a score would come out a little different, and the interval shows by how much.interval_level, a new argument ofPipeline.scorecard, sets its confidence level: 0.95 by default, and for example 0.99 for a wider, more cautious interval. The card keeps it in the new fieldScorecard.interval_level. With the default ten series the interval is wide; raiseinstancesto tighten it. It reaches further below the score than above it, because a few series usually carry most of the error and a small card more often flatters a model than it wrongs it. It only knows the series the card drew, not kinds of series the card did not draw. For the statistics: each series is left out in turn and the rest are scored, and the spread of those scores on the log-odds scale, times a Student t quantile, gives how far the interval reaches above the score; below it reaches 1 + 1/√n times as far, with n the number of series. Nothing is drawn at random. Scores and verdicts are unchanged. - The printed scorecard marks a verdict that is not settled with a question
mark (
56 Struggles?) and ends with how many verdicts are not settled and how many instances to try. The image draws each interval as a short line beside its score and gives an unsettled verdict a question mark and a paler badge. - Added what a fitted model could score to every scorecard row.
card.tablehas a new columnattainable, aftersettled: the score that the pattern's own model family, fitted to each history, reaches on 200 fresh series of the row. 100 minus it is what the row's own model family loses to estimating its parameters from the history; the distance from a model's score up to it is what that model loses beyond that. It is itself an estimate, good to about a point, and a model can land above it on a given card. The image marks it with a small triangle above each score's line, also when a cell has no interval. Scores, intervals and verdicts are unchanged. - Each
Patternhas a new fieldfitted, a factory for an estimator of the generator's own model family (a sample mean, a least-squares line, a sinusoid of known period, a mean after one estimated break, or AR(1), AR(2) and random-walk models with measurement noise fitted by maximum likelihood). It defaults toNone, so existing six-argumentPattern(...)calls still work. - The default grid's attainable scores are stored. Off the default grid
(another noise level, history length or horizon)
attainableis NaN unless you passscorecard(attainable=True), which simulates the missing values once per session: about 3 to 5 seconds for each autoregressive or random-walk cell and well under a second for the others. - Added
Scorecard.save_baseline(path)andScorecard.compare(baseline), to compare a new version of a pipeline with the version you trusted on the same series.save_baselinewrites a small JSON file with each series' avoidable error (about 17 kB for the default grid at 30 instances), andcompareaccepts that file or anotherScorecardand returns aScorecardComparison. Each cell is "unchanged", "changed, no worse" or "changed and worse": worse when, on the same series, the new version is further from the answer key by more than chance would explain (a paired sign-flip test with Holm's correction across the changed cells), or when a series scored in the baseline now crashes or fails an output check.assert_no_regression()raises on the worse cells. A different grid, seed or number of instances raisesValueError, and fewer than 20 instances warn; use 30. The test does not say that the new version is better, and a regression too small for the number of series passes. - Added
timegym.diagnostics.rank_alarm(observed, calibration, *, alpha=0.05), the one function that now computes the p-value of TimeGym's statistical checks: it asks whether a number is unusually large next to numbers you know are fine. ItsRankAlarmresult holds the p-value(1 + number of calibration values >= observed) / (n + 1), the status, and the threshold the observed value must exceed to fail.covariance_dependence_checknow calls it. Its statuses, messages and p-values are unchanged. Itscritical_valuenow always agrees with the p-value: for some uncommon pairs ofn_calibrationandalpha, where(n_calibration + 1) * (1 - alpha)rounds to just above a whole number (999 calibration ensembles atalpha=0.059, or 99 atalpha=0.41), it used to be the next calibration value up. Atalpha0.001, 0.005, 0.01, 0.025, 0.05, 0.1 and 0.2 it is unchanged for everyn_calibrationup to 200,000. - Added a documentation page, What TimeGym tests, and what it does not.
1.4.1 — 2026-11-14¶
- Deprecated these names. Each still works as in 1.4.0, warns with a
DeprecationWarningthat says what to use instead, and leaves in TimeGym 2.0; the documentation no longer lists them. timegym.smoothing:simple_moving_average,exponential_moving_average;timegym.features:add_lagged_target,cyclical_encoding,add_time_features,add_tsfel_features;timegym.target:multioutput_target,onestep_target,step_ahead_target,fractional_weights,fractional_differencing, and noninteger orders ofdifferencingwith itsfractional_coefficientsargument. The package has no replacement: source notebooks 03, 04 and 05 keep the recipes as worked examples, anddifferencingwith whole orders stays.timegym.data.real.get_stock, with its API page. The package has no replacement; source notebook 02 keeps it as a worked example. Thefeaturesandmarket-dataextras stay until 2.0.Pipeline.plot_tests(...): usepipeline.run(...).plot_forecasts().Pipeline.plot_errors(...): usepipeline.run(...).plot_errors(), withinstances=20for the same 20 draws.timegym.processes.generate_processandtimegym.joint_processes.generate_joint_process: useScenario(kind, context_length, horizon, parameters, n_targets, seed).generate().timegym.processes.process_label: usetimegym.scenarios.scenario_label.timegym.metrics.empirical_crps: usecrps.timegym.scorecard.scorecard(pipeline, ...): usepipeline.scorecard(...).timegym.pipeline.replay_case(report, i): usereport.replay_case(i).default_scenariosis now defined intimegym.scenarios. The old import,from timegym.data.synthetic import default_scenarios, keeps working until 2.0.Scenariocheckscorrelationwith the same check as the composed and financial processes. Error messages for an invalid correlation are worded differently, the tolerances for symmetry, unit diagonal and positive semidefiniteness are slightly stricter, and a matrix that is symmetric only to rounding error is made exactly symmetric before drawing. Scalar correlations draw the same series as before.- Run and report metadata no longer repeat the NumPy and pandas versions as
top-level
numpyandpandaskeys; read them frommetadata["dependencies"], as before. - The API reference no longer documents nine helpers that pipelines and
reports use internally:
pipeline_config,pipeline_from_config,runtime_provenance,diagnostic_settings,transform_config,transform_from_config,fresh_model,is_sklearn_regressorandexception_evidence. They still import without a warning. - Removed the empty
plotsandsklearnextras. They have installed nothing since 1.2.0, when Matplotlib and scikit-learn became core dependencies. An install command that still names one, such aspip install "timegym[plots]", installs the same packages as before and pip warns that the extra is unknown; drop the extra from the command.
1.4.0 — 2026-11-12¶
- Added
LastValueForecaster, the last-value baseline under its own name: the same forecasts asNaiveForecaster("last")with nothing to set, so a scorecard reads "LastValueForecaster: 51/100". It replays from a report like the other built-in models, and the README, the quick start and the example scripts now score it. The hand-written last-value example in the README and the custom-model tutorial is now calledRepeatLast. - The tutorials moved out of
notebooks/intotutorials/, numbered 01–12 in reading order, with "Write and test a custom model" second. The 15 source notebooks that generate the package are insource/, with the 2021 archive insource/archive/, and the README and site images indocs/images/. The old tutorial addresses on the documentation site redirect to the new ones, and the README's images now show on PyPI too.
1.3.0 — 2026-11-11¶
- A custom model's
predictmay return a plain list or NumPy array: one value per requested step for one series, or one row per step and one column per series. TimeGym labels the rows withfuture_indexand the columns with the context's series.Forecast(future_index, values)takes one value per step for a single series, andtarget_namesnow defaults toNone, meaning the task's series in order. The last-value forecaster needs no NumPy and no target names:self.last = context.iloc[-1]infit, thenForecast(future_index, [self.last] * len(future_index))inpredict. Pipeline.predict(context, future_index)also takes a list or NumPy array as the past (labelled 0, 1, 2, ...) and any sequence of labels asfuture_index.- Forecast and error plots use the scorecard's look: gray dots for
observations, a black answer key, blue forecast crosses and one key above the
panels in plain words. Each forecast panel shows the case's score as a colored
badge, and only the last four horizons of history unless
plot_forecasts(history="all")or a number of steps is given.plot_errorsmarks each row's median. - The scorecard says "1 kind of series" for a one-row card, and the compact image puts each noise level's sd on its own line when three or more levels would run their headers together.
1.2.0 — 2026-11-10¶
- Added the scorecard:
Pipeline(model).scorecard()runs a forecaster on ten kinds of series at low and high noise and returns aScorecard. Its image gives a 0-100 score, what the model is good at and fails at, the mistakes it makes (for example Values one step late or Wrong dates), and for each kind of series what can be predicted and what cannot by design.print(card)gives the same as Markdown;card.save(path)writes PNG, SVG or PDF; the JSON report stays available ascard.report. Source notebook 13 builds it. - Added the scenario grid behind it:
PATTERNS,scenario_grid()andGridCellfromtimegym, withnoise_levels()intimegym.grid. Two noise levels by default; more levels fill the range between the same two extremes. - Added the
ar2scenario kind (stationary AR(2), irregular cycles) and an optionalnoiseparameter forar1,ar2andrandom_walk: measurement noise on the hidden process, with an exact Kalman-filter reference. Scenarios withoutnoisekeep their references and manifests. - One seed drives a whole run:
Pipeline.test,run,plot_testsandplot_errorstakeseed=0andinstances, using seedsseed, seed + 1, .... The default is unchanged (seeds=[0, 1, 2]).seed=Nonedraws a fresh seed and records it in the report metadata. An explicitseedslist still works. - A model's
predictmay return a pandas DataFrame indexed by the requested dates, or a Series for one series, as well as aForecast. A plain class withfitandpredictcan be passed as an instance; each case fits a deep copy and the original is never fitted. report.checkscounts each output check in plain words (for example Forecasts the requested dates) with the cases that passed and failed.assert_passed()names the failed checks first. The scorecard reports how many steps wrong dates are shifted.- Forecast plots title each panel with the case's 0-100 score, its error
against the answer key and its error against what happened, instead of
"observed MSE" and "mean-reference MSE";
plot_errorslabels its axis "Error against the answer key".ForecastRun.titlesnames rows in plain words, and a scorecard's run uses its pattern and noise titles. -
pip install timegymnow includes Matplotlib and scikit-learn. Theplotsandsklearnextras remain as empty aliases so older install commands work. -
The API reference pages, except Market data, end with signatures and docstrings generated from the code by mkdocstrings; the
docsextra addsmkdocstringsandmkdocstrings-python. Every public class, method and property now has a docstring. - Added a capability map to the Concepts pages. It crosses the behaviors a forecaster needs with the four kinds of evidence, and links the scenario family, diagnostic and tutorial for each pair that a tutorial covers.
1.1.0 — 2026-11-05¶
- Added reversible target transforms to
timegym.target:LogTransform,BoxCoxTransform,DifferenceTransformandComposedTransform, withtransform_configandtransform_from_configfor configuration and replay. Pipeline(..., target_transform=None)fits a fresh copy of the transform on each context and inverts the model's forecast before evaluation.SklearnForecasteradds thedirectandmultioutputreductions besiderecursive;timegym.models.REDUCTIONSlists them andPipeline(reduction=...)selects one.- Pipeline configuration schema 3 records
target_transform; schema 2 configurations remain readable. - Added tutorials 29 (target transforms) and 30 (reductions).
- Removed the command-line interface: the
timegymconsole script,python -m timegym, thetimegym.climodule and source notebook 13. TimeGym is used as a Python package. examples/reproduce_report.pyis a standalone script: it replays one case withTestReport.read(...).replay_case(...), prints the comparison and exits 1 when the case is not reproduced. The installed-wheel CI job replays the report saved bytools/smoke_installed.py --report.- Removed
Pipeline.plot_error(), the 1.0 alias ofPipeline.plot_errors(). - Pipeline configuration schema 1 (
strategyinstead ofreduction) is no longer read;pipeline_from_configaccepts schemas 2 and 3. - Removed
timegym.joint_processes.resolve_joint_process(); calltimegym.processes.resolve_process()with the same arguments.
1.0.0 — 2026-10-30¶
Not published to PyPI; 1.1.0 is the first PyPI release. It replaced the 2021 prototype: forecast contracts for point means, marginal quantiles and joint samples; known conditional references for Gaussian, composed, jump, GARCH and hidden-regime scenarios, for one or several dependent targets; fresh-fitting pipelines, structured diagnostics, validated report loading and allowlisted replay; notebook-first source; the tutorials, the manuscript and two controlled studies; tag-driven PyPI releases and citation metadata. Pipeline's strategy parameter became reduction, and get_stock defaults to auto_adjust=True. The 2021 API changed substantially.