Changelog
Source:NEWS.md
alloscore2 0.1.0
Initial package setup: repository layout, GitHub Actions workflows for
R CMD check, lint, format, test coverage and pkgdown, and the Air and lintr configuration.Ported the allocation and scoring machinery from the original alloscore:
allocate(),alloscore()and its methods,post_process(), the oracle functions, the gpl loss family,add_pdqr_funs(),slim(), thestdize_*_params()helpers and thezxh_tab2andzxh_tab3datasets.Ported
plot_components(),plot_components_slim(),plot_scores_slim()andplot_iterations().Added
as_alloscore_df(),allocate_model_out()andalloscore_model_out(), which take a hubversemodel_out_tblandoracle_outputdirectly. Predictive quantiles are turned into cdfs and quantile functions withdistfromq, so the conversion that callers used to hand-roll is no longer needed. Only thequantileoutput type is supported.Added a README with runnable examples and two vignettes: an overview of scoring hubverse forecasts, and the validation against published newsvendor optima.
Results agree with the original package to within root-finding tolerance; see
tests/testthat/test-legacy-equivalence.R.
Bug fixes relative to the original package
The
O/Uover/under-cost parameterization now works.gpl_loss_fun()andexp_gpl_loss_fun()previously errored on it anddexp_gpl_loss()silently returnedNULL.A supplied
dgis now honored instead of being silently discarded and recomputed fromg.exp_gpl_loss_fun()now applies itsoffsetargument, which was accepted and ignored.new_gpl_df()can inferNfrom its arguments; the code path referred to an undefined variable.alloscore()on aslimobject now honorsagainst_oracle, which was accepted and ignored.allocate()returns a well-formedallocatedobject when no target has any marginal benefit. It previously returned a data frame with noxdfcolumn, no class and no attributes, which nothing downstream could consume.allocate()now fails with a clear message whenghas an unbounded derivative at zero, asg = "log(x)"does. It previously emitted messages and returned its initial iterate unchanged. Use a shifted increment function such asg = "log(1 + x)".Every dplyr and tidyr call is namespaced and declared. The original package only worked with the tidyverse attached.
weights.allocated()andalloscore.slim()now match the signatures of their generics.plot_components()andplot_scores_slim()work. They previously called the nonexistenttidyr::any_of()and referred to an undefined variable respectively.plot_iterations()no longer callsrequire()at runtime;patchworkis a declared dependency. It also accepts a single row ofallocate_model_out()output, not only anallocatedobject.Every ggplot2, forcats and scales call is namespaced and declared.