Package: psvr 0.1.0

psvr: Percentage-Error Support Vector Regression

Implements four support vector regression (SVR) models derived from a unified mathematical framework for percentage-error loss functions: epsilon-SVR minimizing the mean absolute percentage error (MAPE), its symmetric kernel extension, least-squares SVR (LS-SVR) minimizing the root mean square percentage error (RMSPE), and its symmetric counterpart. All models require strictly positive targets. The epsilon-SVR models are solved via a built-in sequential minimal optimization (SMO) algorithm (with 'osqp' available as an optional alternative backend) and the LS-SVR models via a linear system (base R). See Benavides-Herrera et al. (2026) <doi:10.3390/math14101679> for the mathematical derivations.

Authors:Pablo Benavides-Herrera [aut, cre]

psvr_0.1.0.tar.gz
psvr_0.1.0.zip(r-4.7-x86_64)psvr_0.1.0.zip(r-4.7-arm64)psvr_0.1.0.zip(r-4.6-x86_64)psvr_0.1.0.zip(r-4.6-arm64)psvr_0.1.0.zip(r-4.5-x86_64)
psvr_0.1.0.tgz(r-4.6-x86_64)psvr_0.1.0.tgz(r-4.6-arm64)psvr_0.1.0.tgz(r-4.5-x86_64)psvr_0.1.0.tgz(r-4.5-arm64)
psvr_0.1.0.tar.gz(r-4.7-arm64)psvr_0.1.0.tar.gz(r-4.7-x86_64)psvr_0.1.0.tar.gz(r-4.6-arm64)psvr_0.1.0.tar.gz(r-4.6-x86_64)
psvr_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
psvr/json (API)

# Install 'psvr' in R:
install.packages('psvr', repos = c('https://pbenavidesh.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/pbenavidesh/psvr/issues

Pkgdown/docs site:https://pbenavidesh.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

openblascpp

4.95 score 1 stars 25 exports 103 dependencies

Last updated from:27c2594494. Checks:4 ERROR, 11 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR231
linux-devel-x86_64OK251
source / vignettesOK252
linux-release-arm64ERROR224
linux-release-x86_64OK242
macos-release-arm64OK233
macos-release-x86_64OK398
macos-oldrel-arm64OK300
macos-oldrel-x86_64OK500
windows-devel-arm64ERROR426
windows-devel-x86_64OK275
windows-release-arm64ERROR423
windows-release-x86_64OK211
windows-oldrel-x86_64OK217
wasm-releaseOK162

Exports:cost_psvrcost_psvr_ls_datamake_kernelmargin_percentagepsvr_cvpsvr_mapepsvr_mape_linearpsvr_mape_linear_fitpsvr_mape_polypsvr_mape_poly_fitpsvr_mape_rbfpsvr_mape_rbf_fitpsvr_option_addpsvr_option_add_cost_lspsvr_rmspepsvr_rmspe_linearpsvr_rmspe_linear_fitpsvr_rmspe_polypsvr_rmspe_poly_fitpsvr_rmspe_rbfpsvr_rmspe_rbf_fitrbf_sigma_psvrrbf_sigma_psvr_datasigma_heuristicsym_type_param

Dependencies:base64encbslibcachemclasscliclockcodetoolscpp11data.tablediagramdialsDiceDesigndigestdplyrevaluatefarverfastmapfontawesomefsfurrrfuturefuture.applyGauProgenericsggplot2globalsgluegowergtablehardhathighrhtmltoolsipredisobandjquerylibjsonliteKernSmoothknitrlabelinglatticelavalbfgslifecyclelistenvlubridatemagrittrMASSMatrixmemoisemimemixoptmodelenvnnetnumDerivparallellyparsnippillarpkgconfigprettyunitsprodlimprogressrpurrrR6rappdirsRColorBrewerRcppRcppArmadillorecipesrlangrmarkdownrpartrsampleS7sassscalessfdshapeslidersparsevctrssplitfngrSQUAREMstringistringrsurvivaltailortibbletidyrtidyselecttimechangetimeDatetinytextunetzdbutf8vctrsviridisLitewarpwithrworkflowsworkflowsetsxfunyamlyardstick

Getting Started with psvr
Introduction | Fuel-economy data | 70 / 30 train–test split | Helper metrics | Baseline: linear regression | Model 1: ε-SVR with MAPE | Model 3: LS-SVR with RMSPE | Comparing objectives | Using psvr with tidymodels | Hyperparameter search ranges | rbf_sigma is a length scale, not a precision | rbf_sigma_psvr_data() needs preprocessed predictors | LS-SVR needs cost_psvr_ls_data(), and it cannot be automated | cost is not comparable across datasets either | Tuning sym_type cannot answer "does symmetry help" | The outcome stays in original units | References

Last update: 2026-08-12
Started: 2026-04-18

tidymodels workflow with psvr
Data | 1 — Split | 2 — Preprocessing recipe | 3 — Model spec with tune() | 4 — Workflow | 5 — Tune with 5-fold CV | 6 — Select best | 7 — Final fit and test-set evaluation | 8 — Inspecting the fitted psvr model

Last update: 2026-08-11
Started: 2026-04-18

Readme and manuals

Help Manual

Help pageTopics
Extract coefficients from a psvr_mape modelcoef.psvr_mape
Extract coefficients from a psvr_mape_sym modelcoef.psvr_mape_sym
Extract coefficients from a psvr_rmspe modelcoef.psvr_rmspe
Extract coefficients from a psvr_rmspe_sym modelcoef.psvr_rmspe_sym
Cost parameter with extended range for psvr modelscost_psvr
Data-driven cost range for LS-SVR psvr modelscost_psvr_ls_data
Create a kernel functionmake_kernel
Insensitivity margin in percentage unitsmargin_percentage
Predict from a fitted epsilon-SVR with MAPE modelpredict.psvr_mape
Predict from a fitted symmetric epsilon-SVR with MAPE modelpredict.psvr_mape_sym
Predict from a fitted LS-SVR with RMSPE modelpredict.psvr_rmspe
Predict from a fitted symmetric LS-SVR with RMSPE modelpredict.psvr_rmspe_sym
Print method for psvr_mape objectsprint.psvr_mape
Print method for psvr_mape_sym objectsprint.psvr_mape_sym
Print method for psvr_rmspe objectsprint.psvr_rmspe
Print method for psvr_rmspe_sym objectsprint.psvr_rmspe_sym
Cross-validate psvr_mape() with automatic warm-start across foldspsvr_cv
Fit an epsilon-SVR with MAPE losspsvr_mape
Parsnip model specs: epsilon-SVR with MAPE loss (Model 1)psvr_mape_linear psvr_mape_poly psvr_mape_rbf psvr_mape_specs
Apply data-driven rbf_sigma to all psvr workflows in a workflow setpsvr_option_add
Apply data-driven LS-SVR cost range to all m3/m4 workflows in a workflow setpsvr_option_add_cost_ls
Fit a least-squares SVR with RMSPE losspsvr_rmspe
Parsnip model specs: LS-SVR with RMSPE loss (Model 3)psvr_rmspe_linear psvr_rmspe_poly psvr_rmspe_rbf psvr_rmspe_specs
Extract training fitted values from a psvr modelfitted.psvr_mape fitted.psvr_mape_sym fitted.psvr_rmspe fitted.psvr_rmspe_sym psvr-fitted
Extract training residuals from a psvr modelpsvr-residuals residuals.psvr_mape residuals.psvr_mape_sym residuals.psvr_rmspe residuals.psvr_rmspe_sym
RBF sigma parameter for psvr modelsrbf_sigma_psvr
RBF sigma parameter with data-driven range for psvr modelsrbf_sigma_psvr_data
Median-distance heuristic for RBF kernel bandwidthsigma_heuristic
Summarize a fitted epsilon-SVR with MAPE losssummary.psvr_mape
Summarize a fitted symmetric epsilon-SVR with MAPE losssummary.psvr_mape_sym
Summarize a fitted LS-SVR with RMSPE losssummary.psvr_rmspe
Summarize a fitted symmetric LS-SVR with RMSPE losssummary.psvr_rmspe_sym
Dials parameter for symmetry typesym_type_param