Puppet Class: profile::product_analytics::probabilistic_programming

Defined in:
modules/profile/manifests/product_analytics/probabilistic_programming.pp

Overview

Provision for probabilistic programming

Install and configure R and install Product Analytics-specific essential R/Python packages for statistical inference and modeling with probabilistic programming and Bayesian methods.

Due to the outdated version of R on the currently available Ubuntu version (Trusty), it is recommended to only apply this profile (and any profiles or roles that include it) to instances running on Debian (Jessie or newer).

filtertags: labs-project-discovery-stats



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'modules/profile/manifests/product_analytics/probabilistic_programming.pp', line 12

class profile::product_analytics::probabilistic_programming {
    require profile::product_analytics::base

    $r_packages = [
        'rstan',     # R Interface to Stan
        'rstanarm',  # Bayesian Applied Regression Modeling via Stan
        'brms',      # Bayesian Regression Models using Stan
        'tidybayes', # Tidy Data and 'Geoms' for Bayesian Models
    ]
    r_lang::cran { $r_packages:
        require => [
            R_lang::Cran['Rcpp'],
            R_lang::Cran['RcppEigen'],
            R_lang::Cran['BH'],
            R_lang::Cran['tidyverse']
        ],
        timeout => 9000,
    }
    r_lang::cran { 'greta':
        require => [
            R_lang::Cran['tensorflow'],
            R_lang::Cran['tidybayes']
        ]
    }

    $python_libraries = [
        'pymc3',                  # Bayesian statistical modeling & probabilistic ML
        'pystan',                 # Python interface to Stan
        'tensorflow-probability', # Probabilistic reasoning with TensorFlow
        'edward'                  # note: Edward2 is built into TF Probability
    ]
    package { $python_libraries:
        ensure   => 'installed',
        require  => [
            Package['python-dev'],
            Package['python-numpy'],
            Package['python-wheel'],
            Package['python-h5py'],
            Package['python-cython'],
            Package['tensorflow']
        ],
        provider => 'pip',
    }

}