Skip to content

Commit 2ffe72f

Browse files
pschilniels89bachmannpatrick
authored
Release v0.6.0 (bachmannpatrick#117)
* Test refactoring (bachmannpatrick#95) * BG/NBD nocov and staticcov (bachmannpatrick#49) * GGompertz/NBD nocov and staticcov (bachmannpatrick#92) * Reduce tests on CI (bachmannpatrick#104) * Test dyncov unconditional expectation, LL, and CET intermediate results (bachmannpatrick#105, bachmannpatrick#110) * Dyncov CET for k==1 (bachmannpatrick#106) * Refactor clvtime correctness tests (bachmannpatrick#107) * Pnbd PAlive numerically more stable using LL (bachmannpatrick#103) * Feature add new models to walkthrough (bachmannpatrick#109) * Prepare Release v0.6 (bachmannpatrick#102) Co-authored-by: Patrik Schilter <[email protected]> Co-authored-by: Niels Kübler <[email protected]> Co-authored-by: Patrick Bachmann <[email protected]>
1 parent 0396ef5 commit 2ffe72f

File tree

168 files changed

+10460
-2909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+10460
-2909
lines changed

.github/workflows/Coverage.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,16 @@ jobs:
2828

2929
- name: Test coverage
3030
# run: covr::codecov() # uploads to codecov.io
31-
run: covr::package_coverage(type = "tests", quiet = FALSE)
31+
run: |
32+
33+
# If on a release branch (name starts with 'release'),
34+
# run all tests, including lengthy ones marked with skip_on_ci/skip_on_covr()
35+
if(grepl(pattern = "^release", x = Sys.getenv("GITHUB_HEAD_REF"))){
36+
Sys.setenv(R_COVR="")
37+
print("On release branch: Run all coverage tests (setting R_COVR='')")
38+
}else{
39+
print("Not on release branch: Dont run all tests (skip_on_covr())")
40+
}
41+
42+
covr::package_coverage(type = "tests", quiet = FALSE)
3243
shell: Rscript {0}

.github/workflows/R-CMD-check.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: R-CMD-check
2-
on: push
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
- '!master' # run on every branch except master
7+
38
# CMD checks on win, mac, ubuntu
49
jobs:
510
R-CMD-check:
@@ -47,6 +52,7 @@ jobs:
4752
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
4853
sudo -s eval "$sysreqs"
4954
sudo apt-get install -y qpdf # qpdf needed on ubuntu
55+
sudo apt-get install texlive-xetex # for tinytex
5056
5157
- name: Install tinytex for linux (to build vignettes)
5258
if: runner.os == 'Linux'

.github/workflows/Tests.yaml

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: testthat-tests
2-
on: pull_request # default to types [opened, synchronize, reopened]
2+
# Run tests for every PR and when commiting (push) to development or to the release branch
3+
# pull_request: defaults to types [opened, synchronize, reopened]
4+
on:
5+
pull_request:
6+
branches:
7+
- '*'
8+
push:
9+
branches:
10+
- 'release**'
11+
- 'development'
312
jobs:
413
tests-ubuntu-16-04-R-release:
514
runs-on: ubuntu-16.04
@@ -31,6 +40,16 @@ jobs:
3140
run: |
3241
library(testthat)
3342
library(devtools)
43+
44+
# If on a release branch (name starts with 'release'),
45+
# run all tests, including lengthy ones marked with skip_on_ci()
46+
if(grepl(pattern = "^release", x = Sys.getenv("GITHUB_HEAD_REF"))){
47+
Sys.setenv(CI="")
48+
print("On release branch: Run all tests")
49+
}else{
50+
print("Not on release branch: Dont run all tests (skip_on_ci())")
51+
}
52+
3453
reporter <- RstudioReporter$new() # has to be defined outside capture.output to still print
3554
capture.output(devtools::test(reporter = reporter, stop_on_failure=TRUE, stop_on_warning=TRUE))
3655
shell: Rscript {0}

CLVTools.Rproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ StripTrailingWhitespace: Yes
1818
BuildType: Package
1919
PackageUseDevtools: Yes
2020
PackageInstallArgs: --no-multiarch --with-keep.source
21-
PackageCheckArgs: --no-tests --as-cran
21+
PackageCheckArgs: --no-tests --as-cran --no-vignettes --no-build-vignettes --ignore-vignettes
2222
PackageRoxygenize: rd,collate,namespace

DESCRIPTION

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: CLVTools
22
Title: Tools for Customer Lifetime Value Estimation
3-
Version: 0.5.0
4-
Date: 2020-05-05
3+
Version: 0.6.0
4+
Date: 2020-06-22
55
Authors@R: c(
66
person(given="Patrick", family="Bachmann", email = "[email protected]", role = c("cre","aut")),
77
person(given="Jeffrey", family="Naef", email = "[email protected]",role = "aut"),
@@ -15,9 +15,11 @@ Description: Probabilistic latent customer attrition models (also known as "buy-
1515
predict future purchase behavior of customers. This package includes fast and accurate implementations of various
1616
probabilistic latent customer attrition models for non-contractual settings (e.g., retail business) with and
1717
without time-invariant and time-varying covariates. Currently, the package includes the Pareto/NBD model
18-
(Pareto/Negative-Binomial-Distribution) for the purchase and the attrition processes as well as the Gamma/Gamma model
19-
for the spending process. For reference to the Pareto/NBD model, see Schmittlein DC, Morrison DG, Colombo R (1987) <doi:10.1287/mnsc.33.1.1>.
20-
For reference to the Gamma/Gamma model, see Fader PS, Hardie BG, Lee K (2005) <doi:10.1509/jmkr.2005.42.4.415>.
18+
(Pareto/Negative-Binomial-Distribution), the BG/NBD mode (Beta-Gamma/Negative-Binomial-Distribution) and the GGom/NBD
19+
(Gamma-Gompertz/Negative-Binomial-Distribution) for the purchase and the attrition processes as well as the Gamma/Gamma model
20+
for the spending process. For reference to the Pareto/NBD model, see Schmittlein DC, Morrison DG, Colombo R (1987) <doi:10.1287/mnsc.33.1.1>,
21+
for the BG/NBD model, see Fader PS, Hardie BG, Lee K (2005) <doi:10.1287/mksc.1040.0098> and for the GGom/NBD model see Bemmaor AC, Glady N (2012)
22+
<doi:10.1287/mnsc.1110.1461>. For reference to the Gamma/Gamma model, see Fader PS, Hardie BG, Lee K (2005) <doi:10.1509/jmkr.2005.42.4.415>.
2123
Imports:
2224
data.table (>= 1.12.0),
2325
foreach (>= 1.5.0),
@@ -26,14 +28,14 @@ Imports:
2628
Matrix (>= 1.2-17),
2729
MASS,
2830
optimx (>= 2019-12.02),
29-
Rcpp (>= 0.12.12),
3031
stats,
3132
utils
3233
Suggests:
3334
BTYD,
3435
covr,
3536
doFuture,
3637
doParallel,
38+
future,
3739
knitr,
3840
rmarkdown,
3941
testthat
@@ -42,7 +44,7 @@ URL: https://github.com/bachmannpatrick/CLVTools
4244
BugReports: https://github.com/bachmannpatrick/CLVTools/issues
4345
NeedsCompilation: yes
4446
SystemRequirements: C++11
45-
LinkingTo: Rcpp, RcppArmadillo (>= 0.9.500.2.0), RcppGSL (>= 0.3.7)
47+
LinkingTo: Rcpp(>= 0.12.12), RcppArmadillo (>= 0.9.500.2.0), RcppGSL (>= 0.3.7)
4648
LazyLoad: yes
4749
Encoding: UTF-8
4850
Collate:
@@ -51,12 +53,20 @@ Collate:
5153
'all_generics.R'
5254
'class_clv_time.R'
5355
'class_clv_data.R'
54-
'class_clv_data_staticcovariates.R'
55-
'class_clv_data_dynamiccovariates.R'
5656
'class_clv_model.R'
5757
'class_clv_fitted.R'
58+
'class_clv_model_bgnbd.R'
59+
'class_clv_bgnbd.R'
5860
'class_clv_fitted_staticcov.R'
61+
'class_clv_data_staticcovariates.R'
62+
'class_clv_model_bgnbd_staticcov.R'
63+
'class_clv_bgnbd_staticcov.R'
64+
'class_clv_data_dynamiccovariates.R'
5965
'class_clv_fitted_dynamiccov.R'
66+
'class_clv_model_ggomnbd_nocov.R'
67+
'class_clv_ggomnbd.R'
68+
'class_clv_model_ggomnbd_staticcov.R'
69+
'class_clv_ggomnbd_staticcov.R'
6070
'class_clv_model_pnbd.R'
6171
'class_clv_model_pnbd_staticcov.R'
6272
'class_clv_model_pnbd_dynamiccov.R'

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ importFrom(stats,AIC)
8888
importFrom(stats,BIC)
8989
importFrom(stats,coef)
9090
importFrom(stats,fitted)
91+
importFrom(stats,integrate)
9192
importFrom(stats,logLik)
9293
importFrom(stats,model.frame)
9394
importFrom(stats,model.matrix)

NEWS.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# CLVTools 0.6.0
2+
3+
### NEW FEATURES
4+
* Beta-Geometric/NBD (BG/NBD) model to predict repeat transactions without and with static covariates
5+
* Gamma-Gompertz (GGompertz) model to predict repeat transactions without and with static covariates
6+
* Predictions are now possible for all periods >= 0 whereas before a minimum of 2 periods was required
7+
8+
19
# CLVTools 0.5.0
210
* Initial release of the CLVTools package
311

0 commit comments

Comments
 (0)