diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 4428b4fe1..67008d7dd 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -32,9 +32,9 @@ jobs: python -m pip install quartodoc==0.6.1 - name: Set up Quarto - uses: quarto-dev/quarto-actions/setup@v2 + uses: quarto-dev/quarto-actions/setup@v2 with: - version: 1.2.280 # since this is my local version, we could change it + version: 1.5.57 # since this is my local version, we could change it - name: Build docs shell: bash @@ -43,7 +43,7 @@ jobs: quarto render docs touch docs/_site/.nojekyll - - name: Publish to GitHub + - name: Publish to GitHub if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') # Only from main or a tag uses: quarto-dev/quarto-actions/publish@v2 with: diff --git a/bambi/backend/links.py b/bambi/backend/links.py index 9e5af25d0..f723a8aaa 100644 --- a/bambi/backend/links.py +++ b/bambi/backend/links.py @@ -3,7 +3,7 @@ def probit(x): - """Probit function that ensures result is in (0, 1)""" + """Probit function that ensures result is in (0, 1).""" eps = np.finfo(float).eps result = 0.5 + 0.5 * pt.erf(x / pt.sqrt(2)) result = pt.switch(pt.eq(result, 0), eps, result) @@ -13,7 +13,7 @@ def probit(x): def cloglog(x): - """Cloglog function that ensures result is in (0, 1)""" + """Cloglog function that ensures result is in (0, 1).""" eps = np.finfo(float).eps result = 1 - pt.exp(-pt.exp(x)) result = pt.switch(pt.eq(result, 0), eps, result) @@ -23,7 +23,7 @@ def cloglog(x): def logit(x): - """Logit function that ensures result is in (0, 1)""" + """Logit function that ensures result is in (0, 1).""" eps = np.finfo(float).eps result = pt.sigmoid(x) result = pt.switch(pt.eq(result, 0), eps, result) diff --git a/bambi/backend/model_components.py b/bambi/backend/model_components.py index 61e287040..7ba3abee6 100644 --- a/bambi/backend/model_components.py +++ b/bambi/backend/model_components.py @@ -61,7 +61,7 @@ def build_intercept(self, bmb_model): self.output += InterceptTerm(self.component.intercept_term).build(bmb_model) def build_offsets(self): - """Add intercept term to the PyMC model. + """Add intercept term to the PyMC model We have linear predictors of the form 'X @ b + Z @ u'. This is technically part of 'X @ b' but it is added separately for convenience reasons. @@ -70,7 +70,7 @@ def build_offsets(self): self.output += offset.data.squeeze() def build_common_terms(self, pymc_backend, bmb_model): - """Add common (fixed) terms to the PyMC model. + """Add common (fixed) terms to the PyMC model We have linear predictors of the form 'X @ b + Z @ u'. This creates the 'b' parameter vector in PyMC, computes `X @ b`, and adds it to `self.mu`. @@ -123,7 +123,7 @@ def build_hsgp_terms(self, pymc_backend): self.output += hsgp_term.build() def build_group_specific_terms(self, pymc_backend, bmb_model): - """Add group-specific (random or varying) terms to the PyMC model. + """Add group-specific (random or varying) terms to the PyMC model We have linear predictors of the form 'X @ b + Z @ u'. This creates the 'u' parameter vector in PyMC, computes `Z @ u`, and adds it to diff --git a/bambi/backend/pymc.py b/bambi/backend/pymc.py index 7e879917a..044015141 100644 --- a/bambi/backend/pymc.py +++ b/bambi/backend/pymc.py @@ -59,7 +59,7 @@ def __init__(self): self.pymc_methods = inference_methods.names["pymc"] def build(self, spec): - """Compile the PyMC model from an abstract model specification. + """Compile the PyMC model from an abstract model specification Parameters ---------- @@ -153,7 +153,7 @@ def run( return result def build_potentials(self, spec): - """Add potentials to the PyMC model. + """Add potentials to the PyMC model Potentials are arbitrary quantities that are added to the model log likelihood. See 'Factor Potentials' in @@ -422,7 +422,7 @@ def distributional_components(self): def _posterior_samples_to_idata(samples, model): - """Create InferenceData from samples. + """Create InferenceData from samples Parameters ---------- diff --git a/bambi/backend/terms.py b/bambi/backend/terms.py index 3845331e5..8da04ed1d 100644 --- a/bambi/backend/terms.py +++ b/bambi/backend/terms.py @@ -167,7 +167,7 @@ def name(self): class InterceptTerm: - """Representation of an intercept term in a PyMC model. + """Representation of an intercept term in a PyMC model Parameters ---------- @@ -199,7 +199,7 @@ def name(self): class ResponseTerm: - """Representation of a response term in a PyMC model. + """Representation of a response term in a PyMC model Parameters ---------- @@ -214,19 +214,19 @@ def __init__(self, term, family): self.family = family def build(self, pymc_backend, bmb_model): - """Create and return the response distribution for the PyMC model. + """Create and return the response distribution for the PyMC model Parameters ---------- pymc_backend : bambi.backend.PyMCModel The object with all the backend information bmb_model : bambi.Model - The Bambi model instance + The Bambi model instance. Returns ------- dist : pm.Distribution - The response distribution + The response distribution. """ data = np.squeeze(self.term.data) parent_name = self.family.likelihood.parent @@ -541,7 +541,7 @@ def get_covariance_functions(self): Returns ------- Sequence[pm.gp.Covariance] - A covariance function that can be used with a GP in PyMC + A covariance function that can be used with a GP in PyMC. """ # Get the callable that creates the function diff --git a/bambi/backend/utils.py b/bambi/backend/utils.py index 50f772a00..9541044a3 100644 --- a/bambi/backend/utils.py +++ b/bambi/backend/utils.py @@ -86,7 +86,7 @@ def get_linkinv(link, invlinks): Returns ------- callable - The link function + The link function. """ # If the name is in the backend, get it from there if link.name in invlinks: @@ -126,7 +126,7 @@ def make_weighted_logp(dist: pm.Distribution): Returns ------- - A function that computes the weighted logp + A function that computes the weighted logp. """ def logp(value, *dist_params, weights): @@ -137,7 +137,7 @@ def logp(value, *dist_params, weights): def get_dist_args(dist: pm.Distribution) -> list[str]: - """Get the argument names of a PyMC distribution. + """Get the argument names of a PyMC distribution The argument names are the names of the parameters of the distribution. diff --git a/bambi/data/datasets.py b/bambi/data/datasets.py index 0be57e9ba..2d13c1603 100644 --- a/bambi/data/datasets.py +++ b/bambi/data/datasets.py @@ -182,7 +182,7 @@ * sex: Sex of the patient * disease: The type of disease. Can be "AN", "GN", "PKG", or "other" -McGilchrist, C. A., & Aisbett, C. W. (1991). Regression with frailty in survival analysis. +McGilchrist, C. A., & Aisbett, C. W. (1991). Regression with frailty in survival analysis. Biometrics, 47(2), 461-466 """, ), @@ -195,8 +195,8 @@ def get_data_home(data_home=None): This folder is used to avoid downloading the data several times. By default the data dir is set to a folder named 'bambi_data' in the user home folder. - Alternatively, it can be set by the ``"BAMBI_DATA"`` environment variable or programmatically by - giving an explicit folder path. The ``"~"`` symbol is expanded to the user home folder. If the + Alternatively, it can be set by the `"BAMBI_DATA"` environment variable or programmatically by + giving an explicit folder path. The `"~"` symbol is expanded to the user home folder. If the folder does not already exist, it is automatically created. Parameters @@ -218,7 +218,7 @@ def clear_data_home(data_home=None): Parameters ---------- data_home: str - The path to Bambi data dir. By default a folder named ``"bambi_data"`` in the user home + The path to Bambi data dir. By default a folder named `"bambi_data"` in the user home folder. """ data_home = get_data_home(data_home) @@ -244,9 +244,9 @@ def load_data(dataset=None, data_home=None): Run with no parameters to get a list of all available data sets. - The directory to save can also be set with the environment variable ``BAMBI_HOME``. + The directory to save can also be set with the environment variable `BAMBI_HOME`. The checksum of the dataset is checked against a hardcoded value to watch for data corruption. - Run ``bmb.clear_data_home()`` to clear the data directory. + Run `bmb.clear_data_home()` to clear the data directory. Parameters ---------- diff --git a/bambi/defaults/families.py b/bambi/defaults/families.py index 40d8f15f6..2460c109d 100644 --- a/bambi/defaults/families.py +++ b/bambi/defaults/families.py @@ -299,14 +299,14 @@ def get_builtin_family(name): - """Generate a built-in ``bambi.families.Family`` instance. + """Generate a built-in `bambi.families.Family` instance. - Given the name of a built-in family, this function returns a ``bambi.families.Family`` instance + Given the name of a built-in family, this function returns a `bambi.families.Family` instance that is constructed by calling other utility functions that construct the - ``bambi.families.Likelihood`` and the ``bambi.priors.Prior`` instances that are needed to build + `bambi.families.Likelihood` and the `bambi.priors.Prior` instances that are needed to build the family. - The available built-in families are found in ``SETTINGS_FAMILIES``. + The available built-in families are found in `SETTINGS_FAMILIES`. Parameters ---------- @@ -316,7 +316,7 @@ def get_builtin_family(name): Raises ------ ValueError - If ``name`` is not the name of a built-in family. + If `name` is not the name of a built-in family. Returns ------- diff --git a/bambi/defaults/utils.py b/bambi/defaults/utils.py index 8e6df604e..236803e22 100644 --- a/bambi/defaults/utils.py +++ b/bambi/defaults/utils.py @@ -8,20 +8,20 @@ def generate_prior(dist, **kwargs): """Generate a Prior distribution. - The parameter ``kwargs`` is used to pass hyperpriors that are assigned to the parameters of + The parameter `kwargs` is used to pass hyperpriors that are assigned to the parameters of the prior to be built. Parameters ---------- dist: str, int, float If a string, it is the name of the prior distribution with default values taken from - ``SETTINGS_DISTRIBUTIONS``. If a number, it is a factor used to scale the standard deviation + `SETTINGS_DISTRIBUTIONS`. If a number, it is a factor used to scale the standard deviation of the priors generated automatically by Bambi. Raises ------ ValueError - If ``dist`` is not a string or a number. + If `dist` is not a string or a number. Returns ------- @@ -84,12 +84,12 @@ def get_default_prior(term_type, **kwargs): Raises ------ ValueError - If ``term_type`` is not within the values listed above. + If `term_type` is not within the values listed above. Returns ------- prior: Prior - The instance of Prior according to the ``term_type``. + The instance of Prior according to the `term_type`. """ if term_type in ["intercept", "common"]: prior = generate_prior("Normal") @@ -115,8 +115,8 @@ def generate_likelihood(name, params, parent): The name of the likelihood function. args: dict Indicates the auxiliary parameters and the values for their default priors. The keys are the - names of the parameters and the values are passed to ``generate_prior()`` to obtain the - actual instance of ``bambi.Prior``. + names of the parameters and the values are passed to `generate_prior()` to obtain the + actual instance of `bambi.Prior`. parent: str The name of the parent parameter. In other words, the name of the mean parameter in the likelihood function. diff --git a/bambi/families/family.py b/bambi/families/family.py index f9bb5a98c..c3a17153b 100644 --- a/bambi/families/family.py +++ b/bambi/families/family.py @@ -9,7 +9,7 @@ class Family: - """A specification of model family. + """A specification of model family Parameters ---------- @@ -142,7 +142,7 @@ def posterior_predictive(self, model, posterior, **kwargs): Returns ------- xr.DataArray - A data array with the draws from the posterior predictive distribution + A data array with the draws from the posterior predictive distribution. """ response_dist = get_response_dist(model.family) response_term = model.response_component.term @@ -307,12 +307,12 @@ def get_response_dist(family): Parameters ---------- family : bambi.Family - The family for which the response distribution is wanted + The family for which the response distribution is wanted. Returns ------- pm.Distribution - The response distribution + The response distribution. """ mapping = {"Cumulative": pm.Categorical, "StoppingRatio": pm.Categorical} @@ -328,25 +328,25 @@ def get_response_dist(family): def expand_array(x, ndim): """Add dimensions to an array to match the number of desired dimensions - If x.ndim < ndim, it adds ndim - x.ndim dimensions after the last axis. If not, it is left - untouched. + If `x.ndim < ndim`, it adds `ndim - x.ndim` dimensions after the last axis. If not, + it is left untouched. - For example, if we have a normal regression model with n = 1000, chains = 2, and draws = 500 - the shape of the draws of mu will be (2, 500, 1000) but the shape of the draws of sigma will be - (2, 500). This function makes sure the shape of the draws of sigma is (2, 500, 1) which is - comaptible with (2, 500, 1000). + For example, if we have a normal regression model with `n = 1000`, `chains = 2`, and + `draws = 500` the shape of the draws of mu will be `(2, 500, 1000)` but the shape of the + draws of sigma will be `(2, 500)`. This function makes sure the shape of the draws of + sigma is `(2, 500, 1)` which is comaptible with `(2, 500, 1000)`. Parameters ---------- x : np.ndarray The array ndim : int - The number of desired dimensions + The number of desired dimensions. Returns ------- np.ndarray - The array with the expanded dimensions + The array with the expanded dimensions. """ if x.ndim == ndim: return x diff --git a/bambi/families/likelihood.py b/bambi/families/likelihood.py index 22552a03a..483d36764 100644 --- a/bambi/families/likelihood.py +++ b/bambi/families/likelihood.py @@ -29,7 +29,7 @@ class Likelihood: - """Representation of a Likelihood function for a Bambi model. + """Representation of a Likelihood function for a Bambi model Notes: * `parent` must be in `params` diff --git a/bambi/families/link.py b/bambi/families/link.py index 1e032ef4e..ecc8e31a9 100644 --- a/bambi/families/link.py +++ b/bambi/families/link.py @@ -8,7 +8,7 @@ def force_within_unit_interval(x): - """Make sure data in unit interval is in (0, 1)""" + """Make sure data in unit interval is in (0, 1).""" eps = np.finfo(float).eps x[x == 0] = eps x[x == 1] = 1 - eps @@ -16,7 +16,7 @@ def force_within_unit_interval(x): def force_greater_than_zero(x): - """Make sure data in positive reals is in (0, infty)""" + """Make sure data in positive reals is in (0, infty).""" eps = np.finfo(float).eps x[x == 0] = eps return x @@ -33,32 +33,32 @@ def cloglog(mu): def invcloglog(eta): - """Inverse of the cloglog function that ensures result is in (0, 1)""" + """Inverse of the cloglog function that ensures result is in (0, 1).""" result = 1 - np.exp(-np.exp(eta)) return force_within_unit_interval(result) def probit(mu): - """Probit function that ensures the input is in (0, 1)""" + """Probit function that ensures the input is in (0, 1).""" mu = force_within_unit_interval(mu) return 2**0.5 * special.erfinv(2 * mu - 1) # pylint: disable=no-member def invprobit(eta): - """Inverse of the probit function that ensures result is in (0, 1)""" + """Inverse of the probit function that ensures result is in (0, 1).""" result = 0.5 + 0.5 * special.erf(eta / 2**0.5) # pylint: disable=no-member return force_within_unit_interval(result) def expit(eta): - """Expit function that ensures result is in (0, 1)""" + """Expit function that ensures result is in (0, 1).""" result = special.expit(eta) # pylint: disable=no-member result = force_within_unit_interval(result) return result def logit(mu): - """Logit function that ensures the input is in (0, 1)""" + """Logit function that ensures the input is in (0, 1).""" mu = force_within_unit_interval(mu) return special.logit(mu) # pylint: disable=no-member @@ -115,7 +115,7 @@ def link_not_implemented(*args, **kwargs): class Link: - """Representation of a link function. + """Representation of a link function This object contains two main functions. One is the link function itself, the function that maps values in the response scale to the linear predictor, and the other is the inverse diff --git a/bambi/families/univariate.py b/bambi/families/univariate.py index 0eca7d0a5..27f305a01 100644 --- a/bambi/families/univariate.py +++ b/bambi/families/univariate.py @@ -69,7 +69,7 @@ def get_success_level(self, response): class Beta(UnivariateFamily): - """Beta Family + """Beta family It uses the mean (mu) and sample size (kappa) parametrization of the Beta distribution. """ @@ -495,9 +495,9 @@ class ZeroInflatedPoisson(UnivariateFamily): # pylint: disable = protected-access def get_success_level(term): - """Returns the success level of a categorical term. + """Returns the success level of a categorical term - Whenever the concept of "success level" does not apply, it returns None. + Whenever the concept of "success level" does not apply, it returns `None`. """ if term.kind != "categoric": return None @@ -515,9 +515,9 @@ def get_success_level(term): # pylint: disable = protected-access def get_reference_level(term): - """Returns the reference level of a categorical term. + """Returns the reference level of a categorical term - Whenever the concept of "reference level" does not apply, it returns None. + Whenever the concept of "reference level" does not apply, it returns `None`. """ if term.kind != "categoric": return None diff --git a/bambi/formula.py b/bambi/formula.py index ebcd94cfe..fbe014047 100644 --- a/bambi/formula.py +++ b/bambi/formula.py @@ -15,9 +15,9 @@ class Formula: Parameters ---------- formula : str - A model description written using the formula syntax from the ``formulae`` library. + A model description written using the formula syntax from the `formulae` library. *additionals : str - Additional formulas that describe the + Additional formulas that describe model parameters rather than a response variable. """ def __init__(self, formula: str, *additionals: str): @@ -31,7 +31,7 @@ def check_additionals(self, additionals: Sequence[str]): Parameters ---------- additionals : Sequence[str] - Model formulas that describe model parameters rather than a response variable + Model formulas that describe model parameters rather than a response variable. Returns ------- @@ -53,9 +53,9 @@ def check_additional(self, additional: str): Raises ------ ValueError - If the formula does not contain a response term + If the formula does not contain a response term. ValueError - If the response term is not a plain name + If the response term is not a plain name. """ response = fm.model_description(additional).response @@ -75,7 +75,7 @@ def get_all_formulas(self): Returns ------- list - All the formulas in the instance + All the formulas in the instance. """ return [self.main] + list(self.additionals) @@ -97,13 +97,13 @@ def formula_has_intercept(formula: str) -> bool: def check_ordinal_formula(formula: Formula) -> Formula: - """Check if a supplied formula can be used with an ordinal model. + """Check if a supplied formula can be used with an ordinal model Ordinal models have the following constrains (for the moment): - * A single formula must be passed. This is because Bambi does not support modeling the - thresholds as a function of predictors. - * The intercept is omitted. This is to avoid non-identifiability issues between the intercept - and the thresholds. + * A single formula must be passed. This is because Bambi does not support + modeling the thresholds as a function of predictors. + * The intercept is omitted. This is to avoid non-identifiability issues + between the intercept and the thresholds. """ if len(formula.additionals) > 0: raise ValueError("Ordinal families don't accept multiple formulas") diff --git a/bambi/interpret/create_data.py b/bambi/interpret/create_data.py index 8862d2842..a4e9f80e5 100644 --- a/bambi/interpret/create_data.py +++ b/bambi/interpret/create_data.py @@ -106,7 +106,7 @@ def create_grid( def _pairwise_grid(data_dict: dict) -> pd.DataFrame: """Creates a pairwise grid (cartesian product) of data by using the - key-values of the dictionary. + key-values of the dictionary Parameters ---------- @@ -197,7 +197,7 @@ def create_differences_data( def create_predictions_data(condition_info: ConditionalInfo) -> pd.DataFrame: """Creates either unit level or grid level data for 'predictions' depending - if the user passed covariates. + if the user passed covariates Parameters ---------- diff --git a/bambi/interpret/effects.py b/bambi/interpret/effects.py index 3d4729f00..4c4e3b2b2 100644 --- a/bambi/interpret/effects.py +++ b/bambi/interpret/effects.py @@ -33,7 +33,7 @@ class ResponseInfo: """Stores metadata about the response variable for indexing data in az.InferenceData, computing uncertainty intervals, and creating the summary dataframe in - 'PredictiveDifferences'. + 'PredictiveDifferences' FIXME: is the documentation outdated? @@ -77,8 +77,9 @@ def __post_init__(self): @dataclass class Estimate: """Stores the mean and bounds (uncertainty interval) of 'comparisons' and - 'slopes' estimates. Used in 'PredictiveDifferences' to store typed data - for the summary dataframe. + 'slopes' estimates + + Used in 'PredictiveDifferences' to store typed data for the summary dataframe. Parameters ---------- @@ -130,7 +131,7 @@ def __post_init__(self): class PredictiveDifferences: """Computes predictive differences and their uncertainty intervals for 'comparisons' and 'slopes' effects and returns a summary dataframe of the - results. + results Parameters ---------- @@ -237,10 +238,11 @@ def get_estimate( prob: float = 0.94, ): """Obtain the effect ('comparisons' or 'slopes') estimate and uncertainty - interval using the posterior samples. First, the posterior samples are - subsetted by the variable of interest's values. Then, the effect is - computed for each pairwise combination of the variable of interest's - values. + interval using the posterior samples + + First, the posterior samples are subsetted by the variable of interest's + values. Then, the effect is computed for each pairwise combination of the + variable of interest's values. Parameters ---------- @@ -325,7 +327,8 @@ def get_estimate( def get_summary_df(self, response_dim: np.ndarray) -> pd.DataFrame: """ - Builds the summary dataframe for 'comparisons' and 'slopes' effects. + Builds the summary dataframe for 'comparisons' and 'slopes' effects + There are four scenarios to consider: 1.) If the effect kind is 'comparisons' and more than 2 values are being @@ -401,7 +404,7 @@ def get_summary_df(self, response_dim: np.ndarray) -> pd.DataFrame: def average_by(self, variable: Union[bool, str]) -> pd.DataFrame: """Uses the original 'summary_df' to perform a marginal (if 'variable=True') - or group by average if covariate(s) are passed. + or group by average if covariate(s) are passed Parameters ---------- diff --git a/bambi/interpret/plot_types.py b/bambi/interpret/plot_types.py index 4d56e1f92..c8c53f07f 100644 --- a/bambi/interpret/plot_types.py +++ b/bambi/interpret/plot_types.py @@ -13,7 +13,7 @@ def plot_numeric( legend: bool = True, axes=None, ): - """Plotting of numeric data types. + """Plotting of numeric data types Parameters ---------- @@ -158,7 +158,7 @@ def plot_numeric( def plot_categoric(covariates: Covariates, plot_data: pd.DataFrame, legend: bool = True, axes=None): - """Plotting of categorical data types. + """Plotting of categorical data types Parameters ---------- diff --git a/bambi/interpret/utils.py b/bambi/interpret/utils.py index b06f97c11..3adf3d07a 100644 --- a/bambi/interpret/utils.py +++ b/bambi/interpret/utils.py @@ -19,10 +19,11 @@ class VariableInfo: """ Stores information about the variable (covariate) passed into the 'contrast' - or 'wrt' argument for comparisons and slopes. Depending on the effect type - ('slopes' or 'comparisons'), the values attribute is either: (1) the values - passed with the 'contrast' or 'wrt' argument, or (2) default are values - computed by calling 'set_default_variable_values()'. + or 'wrt' argument for comparisons and slopes + + Depending on the effect type ('slopes' or 'comparisons'), the values attribute + is either: (1) the values passed with the 'contrast' or 'wrt' argument, or (2) + default are values computed by calling 'set_default_variable_values()'. 'VariableInfo' is used to create 'slopes' and 'comparisons' data as well as computing the estimates for the 'slopes' and 'comparisons' effects. @@ -90,17 +91,18 @@ def epsilon_difference(self, x, eps) -> np.ndarray: def set_default_variable_values(self) -> np.ndarray: """ Returns default values for the variable of interest ('contrast' and 'wrt') - for the 'slopes' and 'comparisons' effects depending on the dtype of the - variable of interest, effect type, and if self.grid is True. The scenarios - are described below: + for the 'slopes' and 'comparisons' effects. + + Depends on the dtype of the variable of interest, effect type, and if + self.grid is `True`. The scenarios are described below: If numeric dtype and kind is 'comparisons', the returned value is a centered difference based on the mean of `variable'. If numeric dtype and kind is 'slopes', the returned value is an epsilon - difference based on the mean of `variable'. + difference based on the mean of 'variable'. - If categoric dtype the returned value is the unique levels of `variable'. + If categoric dtype the returned value is the unique levels of 'variable'. """ values = None # Otherwise pylint complains terms = get_model_terms(self.model) @@ -136,7 +138,7 @@ def set_default_variable_values(self) -> np.ndarray: class ConditionalInfo: """ Stores information about the conditional (covariates) passed into the - 'conditional' argument for 'comparisons' and 'slopes' effects. + 'conditional' argument for 'comparisons' and 'slopes' effects 'ConditionalInfo' is used to create 'slopes' and 'comparisons' data as well as computing the estimates for the 'slopes' and 'comparisons' effects. @@ -314,7 +316,7 @@ def enforce_dtypes( def get_group_offset(n, lower: float = 0.05, upper: float = 0.4) -> np.ndarray: """ When plotting categorical variables, this function computes the offset of the - stripplot points based on the number of groups ``n``. + stripplot points based on the number of groups `n`. """ intercept, slope = 3.25, 1 return lower + np.exp(-np.exp(intercept - slope * n)) * (upper - lower) diff --git a/bambi/model_components.py b/bambi/model_components.py index 039fd82f2..081920e39 100644 --- a/bambi/model_components.py +++ b/bambi/model_components.py @@ -13,7 +13,7 @@ class ConstantComponent: """Constant model components This is a component for a target parameter that has no predictors. This could be seen as - an intercept-only model for that parameter. For example, tis is the case for sigma when + an intercept-only model for that parameter. For example, this is the case for sigma when a non-distributional Normal linear regression model is used. Parameters @@ -21,9 +21,9 @@ class ConstantComponent: name : str The name of the component. For example "sigma", "alpha", or "kappa". priors : bambi.priors.Prior - The prior distribution for the parameter + The prior distribution for the parameter. spec : bambi.Model - The Bambi model + The Bambi model. """ def __init__(self, name, prior, spec): @@ -532,9 +532,9 @@ def prepare_prior(prior, kind, auto_scale): prior : Prior or None The prior. kind : string - Accepted values are: ``"intercept"``, ``"common"``, or ``"group_specific"``. + Accepted values are: `"intercept"`, `"common"`, or `"group_specific"`. auto_scale : bool - Whether priors should be scaled or not. Defaults to ``True``. + Whether priors should be scaled or not. Defaults to `True`. Returns ------- @@ -549,5 +549,5 @@ def prepare_prior(prior, kind, auto_scale): elif isinstance(prior, Prior): prior.auto_scale = False else: - raise ValueError("'prior' must be instance of Prior or None.") + raise ValueError("'prior' must be instance of Prior or `None`.") return prior diff --git a/bambi/models.py b/bambi/models.py index bf3e69d10..3858389d3 100644 --- a/bambi/models.py +++ b/bambi/models.py @@ -36,37 +36,37 @@ class Model: - """Specification of model class. + """Specification of model class Parameters ---------- formula : str or bambi.formula.Formula - A model description written using the formula syntax from the ``formulae`` library. + A model description written using the formula syntax from the `formulae` library. data : pandas.DataFrame A pandas dataframe containing the data on which the model will be fit, with column names matching variables defined in the formula. family : str or bambi.families.Family A specification of the model family (analogous to the family object in R). Either - a string, or an instance of class ``bambi.families.Family``. If a string is passed, a - family with the corresponding name must be defined in the defaults loaded at ``Model`` - initialization. Valid pre-defined families are ``"bernoulli"``, ``"beta"``, - ``"binomial"``, ``"categorical"``, ``"gamma"``, ``"gaussian"``, ``"negativebinomial"``, - ``"poisson"``, ``"t"``, and ``"wald"``. Defaults to ``"gaussian"``. + a string, or an instance of class `bambi.families.Family`. If a string is passed, a + family with the corresponding name must be defined in the defaults loaded at `Model` + initialization. Valid pre-defined families are `"bernoulli"`, `"beta"`, + `"binomial"`, `"categorical"`, `"gamma"`, `"gaussian"`, `"negativebinomial"`, + `"poisson"`, `"t"`, and `"wald"`. Defaults to `"gaussian"`. priors : dict Optional specification of priors for one or more terms. A dictionary where the keys are the names of terms in the model, "common," or "group_specific" and the values are - instances of class ``Prior``. If priors are unset, uses automatic priors inspired by + instances of class `Prior`. If priors are unset, uses automatic priors inspired by the R rstanarm library. link : str or Dict[str, str] - The name of the link function to use. Valid names are ``"cloglog"``, ``"identity"``, - ``"inverse_squared"``, ``"inverse"``, ``"log"``, ``"logit"``, ``"probit"``, and - ``"softmax"``. Not all the link functions can be used with all the families. + The name of the link function to use. Valid names are `"cloglog"`, `"identity"`, + `"inverse_squared"`, `"inverse"`, `"log"`, `"logit"`, `"probit"`, and + `"softmax"`. Not all the link functions can be used with all the families. If a dictionary, keys are the names of the target parameters and the values are the names of the link functions. categorical : str or list The names of any variables to treat as categorical. Can be either a single variable - name, or a list of names. If categorical is ``None``, the data type of the columns in - the ``data`` will be used to infer handling. In cases where numeric columns are + name, or a list of names. If categorical is `None`, the data type of the columns in + the `data` will be used to infer handling. In cases where numeric columns are to be treated as categorical (e.g., group specific factors coded as numerical IDs), explicitly passing variable names via this argument is recommended. potentials : A list of 2-tuples. @@ -78,17 +78,17 @@ class Model: element is a n-tuple and second element is a lambda function with n arguments. The number and order of the lambda function has to match the number and order of the variables names. dropna : bool - When ``True``, rows with any missing values in either the predictors or outcome are + When `True`, rows with any missing values in either the predictors or outcome are automatically dropped from the dataset in a listwise manner. auto_scale : bool - If ``True`` (default), priors are automatically rescaled to the data + If `True` (default), priors are automatically rescaled to the data (to be weakly informative) any time default priors are used. Note that any priors explicitly set by the user will always take precedence over default priors. noncentered : bool - If ``True`` (default), uses a non-centered parameterization for normal hyperpriors on - grouped parameters. If ``False``, naive (centered) parameterization is used. + If `True` (default), uses a non-centered parameterization for normal hyperpriors on + grouped parameters. If `False`, naive (centered) parameterization is used. center_predictors : bool - If ``True`` (default), and if there is an intercept in the common terms, the data is + If `True` (default), and if there is an intercept in the common terms, the data is centered by subtracting the mean. The centering is undone after sampling to provide the actual intercept in all distributional components that have an intercept. Note that this changes the interpretation of the prior on the intercept because it refers @@ -242,7 +242,7 @@ def fit( random_seed=None, **kwargs, ): - """Fit the model using PyMC. + """Fit the model using PyMC Parameters ---------- @@ -361,26 +361,26 @@ def fit( ) def build(self): - """Set up the model for sampling/fitting. + """Set up the model for sampling/fitting Creates an instance of the underlying PyMC model and adds all the necessary terms to it. Returns ------- - None + `None`. """ self.backend = PyMCModel() self.backend.build(self) self.built = True def set_priors(self, priors=None, common=None, group_specific=None): - """Set priors for one or more existing terms. + """Set priors for one or more existing terms Parameters ---------- priors : dict Dictionary of priors to update. Keys are names of terms to update; values are the new - priors (either a ``Prior`` instance, or an int or float that scales the default priors). + priors (either a `Prior` instance, or an int or float that scales the default priors). common : Prior, int, or float A prior specification to apply to all common terms included in the model. group_specific : Prior, int, or float @@ -388,7 +388,7 @@ def set_priors(self, priors=None, common=None, group_specific=None): Returns ------- - None + `None`. """ kwargs = dict(zip(["priors", "common", "group_specific"], [priors, common, group_specific])) self._added_priors.update(kwargs) @@ -423,9 +423,9 @@ def _build_priors(self): self.scaler.scale() def _set_priors(self, priors=None, common=None, group_specific=None): - """Internal version of ``set_priors()``, with same arguments. + """Internal version of `set_priors()`, with same arguments. - Runs during ``Model._build_priors()``. + Runs during `Model._build_priors()`. """ # 'common' and 'group_specific' only apply to the parent component parent_component = self.components[self.family.likelihood.parent] @@ -457,25 +457,25 @@ def _set_priors(self, priors=None, common=None, group_specific=None): component.update_priors(prior) def _set_family(self, family, link): - """Set the Family of the model. + """Set the Family of the model Parameters ---------- family : str or bambi.families.Family A specification of the model family. - Either a string, or an instance of class ``families.Family``. + Either a string, or an instance of class `families.Family`. If a string is passed, a family with the corresponding name must be defined in the defaults loaded at model initialization. link : str or Dict[str, str] - The name of the link function to use. Valid names are ``"cloglog"``, ``"identity"``, - ``"inverse_squared"``, ``"inverse"``, ``"log"``, ``"logit"``, ``"probit"``, and - ``"softmax"``. Not all the link functions can be used with all the families. + The name of the link function to use. Valid names are `"cloglog"`, `"identity"`, + `"inverse_squared"`, `"inverse"`, `"log"`, `"logit"`, `"probit"`, and + `"softmax"`. Not all the link functions can be used with all the families. If a dictionary, keys are the names of the target parameters and the values are the names of the link functions. Returns ------- - None + `None`. """ # If string, get builtin family @@ -510,7 +510,7 @@ def set_alias(self, aliases): Returns ------- - None + `None`. """ if not isinstance(aliases, dict): raise ValueError(f"'aliases' must be a dictionary, not a {type(aliases)}.") @@ -650,45 +650,45 @@ def plot_priors( Number of draws to sample from the prior predictive distribution. Defaults to 5000. var_names : str or list A list of names of variables for which to compute the prior predictive - distribution. Defaults to ``None`` which means to include both observed and + distribution. Defaults to `None` which means to include both observed and unobserved RVs. random_seed : int Seed for the random number generator. figsize : tuple - Figure size. If ``None`` it will be defined automatically. + Figure size. If `None` it will be defined automatically. textsize : float - Text size scaling factor for labels, titles and lines. If ``None`` it will be - autoscaled based on ``figsize``. + Text size scaling factor for labels, titles and lines. If `None` it will be + autoscaled based on `figsize`. hdi_prob : float or str Plots highest density interval for chosen percentage of density. - Use ``"hide"`` to hide the highest density interval. Defaults to 0.94. + Use `"hide"` to hide the highest density interval. Defaults to 0.94. round_to : int Controls formatting of floats. Defaults to 2 or the integer part, whichever is bigger. point_estimate : str - Plot point estimate per variable. Values should be ``"mean"``, ``"median"``, ``"mode"`` - or ``None``. Defaults to ``"auto"`` i.e. it falls back to default set in + Plot point estimate per variable. Values should be `"mean"`, `"median"`, `"mode"` + or `None`. Defaults to `"auto"` i.e. it falls back to default set in ArviZ's rcParams. kind : str - Type of plot to display (``"kde"`` or ``"hist"``) For discrete variables this argument + Type of plot to display (`"kde"` or `"hist"`) For discrete variables this argument is ignored and a histogram is always used. bins : integer or sequence or "auto" - Controls the number of bins, accepts the same keywords ``matplotlib.pyplot.hist()`` - does. Only works if ``kind == "hist"``. If ``None`` (default) it will use ``"auto"`` - for continuous variables and ``range(xmin, xmax + 1)`` for discrete variables. + Controls the number of bins, accepts the same keywords `matplotlib.pyplot.hist()` + does. Only works if `kind == "hist"`. If `None` (default) it will use `"auto"` + for continuous variables and `range(xmin, xmax + 1)` for discrete variables. omit_offsets : bool - Whether to omit offset terms in the plot. Defaults to ``True``. + Whether to omit offset terms in the plot. Defaults to `True`. omit_group_specific : bool - Whether to omit group specific effects in the plot. Defaults to ``True``. + Whether to omit group specific effects in the plot. Defaults to `True`. ax : numpy array-like of matplotlib axes or bokeh figures A 2D array of locations into which to plot the densities. If not supplied, ArviZ will create its own array of plot areas (and return it). **kwargs - Passed as-is to ``matplotlib.pyplot.hist()`` or ``matplotlib.pyplot.plot()`` function - depending on the value of ``kind``. + Passed as-is to `matplotlib.pyplot.hist()` or `matplotlib.pyplot.plot()` function + depending on the value of `kind`. Returns ------- - axes: matplotlib axes + axes: matplotlib axes. """ self._check_built() @@ -762,17 +762,17 @@ def prior_predictive(self, draws=500, var_names=None, omit_offsets=True, random_ Number of draws to sample from the prior predictive distribution. Defaults to 500. var_names : str or list A list of names of variables for which to compute the prior predictive distribution. - Defaults to ``None`` which means both observed and unobserved RVs. + Defaults to `None` which means both observed and unobserved RVs. omit_offsets : bool - Whether to omit offset terms in the plot. Defaults to ``True``. + Whether to omit offset terms in the plot. Defaults to `True`. random_seed : int Seed for the random number generator. Returns ------- InferenceData - ``InferenceData`` object with the groups ``prior``, ``prior_predictive`` and - ``observed_data``. + `InferenceData` object with the groups `prior`, `prior_predictive` and + `observed_data`. """ self._check_built() @@ -810,31 +810,31 @@ def predict( Parameters ---------- idata : InferenceData - The ``InferenceData`` instance returned by ``.fit()``. + The `InferenceData` instance returned by `.fit()`. kind : str - Indicates the type of prediction required. Can be ``"response_params"`` or - ``"response"``. The first returns draws from the posterior distribution of the + Indicates the type of prediction required. Can be `"response_params"` or + `"response"`. The first returns draws from the posterior distribution of the likelihood parameters, while the latter returns the draws from the posterior predictive distribution (i.e. the posterior probability distribution for a new observation) in addition to the posterior distribution. Defaults to - ``"response_params"``. + `"response_params"`. data : pandas.DataFrame or None An optional data frame with values for the predictors that are used to obtain out-of-sample predictions. If omitted, the original dataset is used. inplace : bool - If ``True`` it will modify ``idata`` in-place. Otherwise, it will return a copy of - ``idata`` with the predictions added. If ``kind="response_params"``, a new variable - with the name of the parent parameter, e.g. ``"mu"`` and ``"sigma" for a Gaussian - likelihood, or ``"p"`` for a Bernoulli likelihood, is added to the ``posterior`` group. - If ``kind="response"``, it appends a ``posterior_predictive`` group to ``idata``. If + If `True` it will modify `idata` in-place. Otherwise, it will return a copy of + `idata` with the predictions added. If `kind="response_params"`, a new variable + with the name of the parent parameter, e.g. `"mu"` and `"sigma" for a Gaussian + likelihood, or `"p"` for a Bernoulli likelihood, is added to the `posterior` group. + If `kind="response"`, it appends a `posterior_predictive` group to `idata`. If any of these already exist, it will be overwritten. include_group_specific : bool - Determines if predictions incorporate group-specific effects. If ``False``, predictions + Determines if predictions incorporate group-specific effects. If `False`, predictions are made with common effects only (i.e. group specific are set to zero). Defaults to - ``True``. + `True`. sample_new_groups : bool Specifies if it is allowed to obtain predictions for new groups of group-specific terms. - When ``True``, each posterior sample for the new groups is drawn from the posterior + When `True`, each posterior sample for the new groups is drawn from the posterior draws of a randomly selected existing group. Since different groups may be selected at each draw, the end result represents the variation across existing groups. The method implemented is quivalent to `sample_new_levels="uncertainty"` in brms. @@ -1004,29 +1004,29 @@ def graph(self, formatting="plain", name=None, figsize=None, dpi=300, fmt="png") """Produce a graphviz Digraph from a built Bambi model. Requires graphviz, which may be installed most easily with - ``conda install -c conda-forge python-graphviz`` + `conda install -c conda-forge python-graphviz` - Alternatively, you may install the ``graphviz`` binaries yourself, and then - ``pip install graphviz`` to get the python bindings. + Alternatively, you may install the `graphviz` binaries yourself, and then + `pip install graphviz` to get the python bindings. See http://graphviz.readthedocs.io/en/stable/manual.html for more information. Parameters ---------- formatting : str - One of ``"plain"`` or ``"plain_with_params"``. Defaults to ``"plain"``. + One of `"plain"` or `"plain_with_params"`. Defaults to `"plain"`. name : str - Name of the figure to save. Defaults to ``None``, no figure is saved. + Name of the figure to save. Defaults to `None`, no figure is saved. figsize : tuple - Maximum width and height of figure in inches. Defaults to ``None``, the figure size is + Maximum width and height of figure in inches. Defaults to `None`, the figure size is set automatically. If defined and the drawing is larger than the given size, the drawing - is uniformly scaled down so that it fits within the given size. Only works if ``name`` - is not ``None``. + is uniformly scaled down so that it fits within the given size. Only works if `name` + is not `None`. dpi : int Point per inch of the figure to save. - Defaults to 300. Only works if ``name`` is not ``None``. + Defaults to 300. Only works if `name` is not `None`. fmt : str Format of the figure to save. - Defaults to ``"png"``. Only works if ``name`` is not ``None``. + Defaults to `"png"`. Only works if `name` is not `None`. Returns ------- diff --git a/bambi/priors/prior.py b/bambi/priors/prior.py index d4c2da420..00682dbe7 100644 --- a/bambi/priors/prior.py +++ b/bambi/priors/prior.py @@ -3,20 +3,20 @@ class Prior: - """Abstract specification of a term prior. + """Abstract specification of a term prior Parameters ---------- name : str Name of prior distribution. Must be the name of a PyMC distribution - (e.g., ``"Normal"``, ``"Bernoulli"``, etc.) + (e.g., `"Normal"`, `"Bernoulli"`, etc.) auto_scale: bool - Whether to adjust the parameters of the prior or use them as passed. Default to ``True``. + Whether to adjust the parameters of the prior or use them as passed. Default to `True`. kwargs : dict Optional keywords specifying the parameters of the named distribution. dist : pymc.distributions.distribution.DistributionMeta or callable - A callable that returns a valid PyMC distribution. The signature must contain ``name``, - ``dims``, and ``shape``, as well as its own keyworded arguments. + A callable that returns a valid PyMC distribution. The signature must contain `name`, + `dims`, and `shape`, as well as its own keyworded arguments. """ def __init__(self, name, auto_scale=True, dist=None, **kwargs): @@ -27,7 +27,7 @@ def __init__(self, name, auto_scale=True, dist=None, **kwargs): self.dist = dist def update(self, **kwargs): - """Update the arguments of the prior with additional arguments. + """Update the arguments of the prior with additional arguments Parameters ---------- diff --git a/bambi/terms/hsgp.py b/bambi/terms/hsgp.py index 4efdce296..8c4d94b6f 100644 --- a/bambi/terms/hsgp.py +++ b/bambi/terms/hsgp.py @@ -18,14 +18,14 @@ def __init__(self, term, prior, prefix=None): Parameters ---------- term : formulae.terms.terms.Term - A term that was created with ``hsgp(...)``. The caller is an instance of ``HSGP()``. + A term that was created with `hsgp(...)`. The caller is an instance of `HSGP()`. prior : dict The keys are the names of the parameters of the covariance function and the values are - instances of ``bambi.Prior`` or other values that are accepted by the covariance + instances of `bambi.Prior` or other values that are accepted by the covariance function. prefix : str It is used to indicate the term belongs to the component of a non-parent parameter. - Defaults to ``None``. + Defaults to `None`. """ self.term = term self.prior = prior diff --git a/bambi/terms/offset.py b/bambi/terms/offset.py index 05902fc7c..ea7cebc97 100644 --- a/bambi/terms/offset.py +++ b/bambi/terms/offset.py @@ -2,7 +2,7 @@ class OffsetTerm(CommonTerm): - """Representation of a single offset term. + """Representation of a single offset term Parameters ---------- diff --git a/bambi/terms/utils.py b/bambi/terms/utils.py index 46019f257..61e4b36a1 100644 --- a/bambi/terms/utils.py +++ b/bambi/terms/utils.py @@ -3,12 +3,12 @@ def is_single_component(term) -> bool: - """Determines if formulae term contains a single component""" + """Determines if formulae term contains a single component.""" return hasattr(term, "components") and len(term.components) == 1 def is_call_component(component) -> bool: - """Determines if formulae component is the result of a function call""" + """Determines if formulae component is the result of a function call.""" return isinstance(component, fm.terms.call.Call) diff --git a/bambi/transformations.py b/bambi/transformations.py index eb226ed43..66255374c 100644 --- a/bambi/transformations.py +++ b/bambi/transformations.py @@ -5,7 +5,7 @@ def c(*args): # pylint: disable=invalid-name - """Concatenate columns into a 2D NumPy Array""" + """Concatenate columns into a 2D NumPy Array.""" return np.column_stack(args) @@ -21,7 +21,7 @@ def censored(*args): upper bound, only if it's interval censoring, and the third argument contains the censoring statuses. - Valid censoring statuses are + Valid censoring statuses are: * "left": left censoring * "none": no censoring @@ -220,7 +220,7 @@ def __call__( Parameters ---------- m : int, Sequence[int], ndarray - The number of basis vectors. See `HSGP.reconciliate_shape` to see how it is + The number of basis vectors. See `HSGP.reconciliate_shape`? to see how it is broadcasted/recycled. L : float, Sequence[float], Sequence[Sequence[float]], ndarray, optional The boundary of the variable space. See `HSGP.reconciliate_shape` to see how it is @@ -240,9 +240,10 @@ def __call__( distance between two points is 1. This adjustment often improves the sampling speed and convergence. The rescaling also impacts the estimated length-scale parameters, which will resemble those of the scaled predictors rather than the original predictors - when `scale` is `True`. Defaults to `None`, which means the behavior depends on whether - custom priors are passed or not. If custom priors are used, `None` is translated to - `False`. If automatic priors are used, `None` is translated to `True`. + when `scale` is `True`. Defaults to `None`, which means the behavior depends on + whether custom priors are passed or not. If custom priors are used, `None` is + translated to `False`. If automatic priors are used, `None` is translated to + `True`. iso : bool, optional Determines whether to use an isotropic or non-isotropic Gaussian Process. If isotropic, the same level of smoothing is applied to all predictors, @@ -257,12 +258,13 @@ def __call__( ------- values A NumPy array of shape (observations_n, variables_n) or - (observations_n, variables_n + 1) if `by` is not None. + (observations_n, variables_n + 1) if `by` is not `None`. Raises ------ ValueError - When both `L` and `c` are `None` or when both of them are not `None` at the same time. + When both `L` and `c` are `None` or when both of them are not `None` at the + same time. """ values = np.column_stack(x) @@ -360,17 +362,17 @@ def as_matrix(x): Parameters ---------- x : np.ndarray - Array + Array. Returns ------- np.ndarray - A two dimensional array + A two dimensional array. Raises ------ ValueError - If the input has more than two dimensions + If the input has more than two dimensions. """ x = np.atleast_1d(x) if x.ndim == 1: diff --git a/bambi/utils.py b/bambi/utils.py index 6decc66db..4647d4522 100644 --- a/bambi/utils.py +++ b/bambi/utils.py @@ -10,7 +10,7 @@ def listify(obj): - """Wrap all non-list or tuple objects in a list. + """Wrap all non-list or tuple objects in a list Provides a simple way to accept flexible arguments. """ @@ -33,7 +33,7 @@ def multilinify(sequence: Sequence[str], sep: str = ",") -> str: def wrapify(string: str, width: int = 100, indentation: int = 2) -> str: - """Wraps long strings into multiple lines. + """Wraps long strings into multiple lines This function is used to print the model summary. """ @@ -49,7 +49,7 @@ def wrapify(string: str, width: int = 100, indentation: int = 2) -> str: def extract_argument_names(expr, accepted_funcs): - """Extract the names of the arguments passed to a function. + """Extract the names of the arguments passed to a function This is used to extract the labels from function calls such as `c(y1, y2, y3, y3)`. @@ -63,7 +63,7 @@ def extract_argument_names(expr, accepted_funcs): Returns ------- list - If all criteria are met, the names of the arguments. Otherwise it returns None. + If all criteria are met, the names of the arguments. Otherwise it returns `None`. """ # Extract the first thing in the body parsed_expr = ast.parse(expr).body[0] @@ -93,7 +93,7 @@ def extract_argument_names(expr, accepted_funcs): def clean_formula_lhs(x): - """Remove the left hand side of a model formula and the tilde. + """Remove the left hand side of a model formula and the tilde Parameters ---------- @@ -103,7 +103,7 @@ def clean_formula_lhs(x): Returns ------- str - The right hand side of the model formula + The right hand side of the model formula. """ assert "~" in x position = x.find("~") @@ -119,28 +119,28 @@ def get_aliased_name(term): Parameters ---------- term : BaseTerm - The term + The term. Returns ------- str - The aliased name + The aliased name. """ return term.alias if term.alias else term.name def is_single_component(term) -> bool: - """Determines if formulae term contains a single component""" + """Determines if formulae term contains a single component.""" return hasattr(term, "components") and len(term.components) == 1 def is_call_component(component) -> bool: - """Determines if formulae component is the result of a function call""" + """Determines if formulae component is the result of a function call.""" return isinstance(component, fm.terms.call.Call) def is_stateful_transform(component): - """Determines if formulae call component is a stateful transformation""" + """Determines if formulae call component is a stateful transformation.""" return component.call.stateful_transform is not None diff --git a/docs/changelog.qmd b/docs/changelog.qmd index 4213db1aa..7beda89ae 100644 --- a/docs/changelog.qmd +++ b/docs/changelog.qmd @@ -9,11 +9,22 @@ pagetitle: "Changelog" ### New features +### Maintenance and fixes + +### Documentation + +### Deprecation + +## 0.14.0 + +### New features + * Add configuration facilities to Bambi (#745) * Interpet submodule now outputs informative messages when computing default values (#745) * Bambi supports weighted responses (#761) * Bambi supports constrained responses (#764) * Implement `compute_log_likelihood()` method to compute the log likelihood on a model (#769) +* Add a class `InferenceMethods` that allows users to access the available inference methods and kwargs (#795) ### Maintenance and fixes @@ -21,13 +32,24 @@ pagetitle: "Changelog" * Fix `get_model_covariates()` utility function (#801) * Upgrade PyMC dependency to >= 5.13 (#803) * Use `pm.compute_deterministics()` to compute deterministics when bayeux based samplers are used (#803) +* Wrap all the parameters of the response distribution (the likelihood) with a `pm.Deterministic` (#804) +* Keep `bayeux-ml` as the single direct JAX-related dependency (#804) +* The response component only holds response information about the response, not about predictors of the parent parameter (#804) +* Resolve import error associated with bayeux (#822) ### Documentation * Our Code of Conduct now includes how to send a report (#783) +* Add polynomial regression example (#809) +* Add Contact form to our webpage (#816) ### Deprecation +* `f"{response_name}_obs"` has been replaced by `"__obs__"` as the dimension name for the observation index (#804) +* `f"{response_name}_{parameter_name}"` is no longer the name for the name of parameters of the likelihood. Now Bambi uses `"{parameter_name}"` (#804) +* `kind` in `Model.predict()` now use `"response_params"` and `"response"` instead of `"mean"` and `"pps"` (#804) +* `include_mean` has been replaced by `include_response_params` in `Model.fit()` (#804) + ## 0.13.0 This is the first version of Bambi that is released with a Governance structure. Added in #709. diff --git a/docs/objects.json b/docs/objects.json index be7c31329..bbab99dfd 100644 --- a/docs/objects.json +++ b/docs/objects.json @@ -1 +1 @@ -{"project": "bambi", "version": "0.0.9999", "count": 60, "items": [{"name": "bambi.Model.build", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.build", "dispname": "-"}, {"name": "bambi.models.Model.build", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.build", "dispname": "bambi.Model.build"}, {"name": "bambi.Model.compute_log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.compute_log_likelihood", "dispname": "-"}, {"name": "bambi.models.Model.compute_log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.compute_log_likelihood", "dispname": "bambi.Model.compute_log_likelihood"}, {"name": "bambi.Model.fit", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.fit", "dispname": "-"}, {"name": "bambi.models.Model.fit", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.fit", "dispname": "bambi.Model.fit"}, {"name": "bambi.Model.graph", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.graph", "dispname": "-"}, {"name": "bambi.models.Model.graph", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.graph", "dispname": "bambi.Model.graph"}, {"name": "bambi.Model.plot_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.plot_priors", "dispname": "-"}, {"name": "bambi.models.Model.plot_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.plot_priors", "dispname": "bambi.Model.plot_priors"}, {"name": "bambi.Model.predict", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.predict", "dispname": "-"}, {"name": "bambi.models.Model.predict", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.predict", "dispname": "bambi.Model.predict"}, {"name": "bambi.Model.prior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.prior_predictive", "dispname": "-"}, {"name": "bambi.models.Model.prior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.prior_predictive", "dispname": "bambi.Model.prior_predictive"}, {"name": "bambi.Model.set_alias", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_alias", "dispname": "-"}, {"name": "bambi.models.Model.set_alias", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_alias", "dispname": "bambi.Model.set_alias"}, {"name": "bambi.Model.set_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_priors", "dispname": "-"}, {"name": "bambi.models.Model.set_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_priors", "dispname": "bambi.Model.set_priors"}, {"name": "bambi.Model", "domain": "py", "role": "class", "priority": "1", "uri": "api/Model.html#bambi.Model", "dispname": "-"}, {"name": "bambi.models.Model", "domain": "py", "role": "class", "priority": "1", "uri": "api/Model.html#bambi.Model", "dispname": "bambi.Model"}, {"name": "bambi.Formula.check_additional", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additional", "dispname": "-"}, {"name": "bambi.formula.Formula.check_additional", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additional", "dispname": "bambi.Formula.check_additional"}, {"name": "bambi.Formula.check_additionals", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additionals", "dispname": "-"}, {"name": "bambi.formula.Formula.check_additionals", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additionals", "dispname": "bambi.Formula.check_additionals"}, {"name": "bambi.Formula.get_all_formulas", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.get_all_formulas", "dispname": "-"}, {"name": "bambi.formula.Formula.get_all_formulas", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.get_all_formulas", "dispname": "bambi.Formula.get_all_formulas"}, {"name": "bambi.Formula", "domain": "py", "role": "class", "priority": "1", "uri": "api/Formula.html#bambi.Formula", "dispname": "-"}, {"name": "bambi.formula.Formula", "domain": "py", "role": "class", "priority": "1", "uri": "api/Formula.html#bambi.Formula", "dispname": "bambi.Formula"}, {"name": "bambi.Prior.update", "domain": "py", "role": "function", "priority": "1", "uri": "api/Prior.html#bambi.Prior.update", "dispname": "-"}, {"name": "bambi.priors.prior.Prior.update", "domain": "py", "role": "function", "priority": "1", "uri": "api/Prior.html#bambi.Prior.update", "dispname": "bambi.Prior.update"}, {"name": "bambi.Prior", "domain": "py", "role": "class", "priority": "1", "uri": "api/Prior.html#bambi.Prior", "dispname": "-"}, {"name": "bambi.priors.prior.Prior", "domain": "py", "role": "class", "priority": "1", "uri": "api/Prior.html#bambi.Prior", "dispname": "bambi.Prior"}, {"name": "bambi.Family.log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.log_likelihood", "dispname": "-"}, {"name": "bambi.families.family.Family.log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.log_likelihood", "dispname": "bambi.Family.log_likelihood"}, {"name": "bambi.Family.posterior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.posterior_predictive", "dispname": "-"}, {"name": "bambi.families.family.Family.posterior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.posterior_predictive", "dispname": "bambi.Family.posterior_predictive"}, {"name": "bambi.Family.set_default_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.set_default_priors", "dispname": "-"}, {"name": "bambi.families.family.Family.set_default_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.set_default_priors", "dispname": "bambi.Family.set_default_priors"}, {"name": "bambi.Family", "domain": "py", "role": "class", "priority": "1", "uri": "api/Family.html#bambi.Family", "dispname": "-"}, {"name": "bambi.families.family.Family", "domain": "py", "role": "class", "priority": "1", "uri": "api/Family.html#bambi.Family", "dispname": "bambi.Family"}, {"name": "bambi.Likelihood", "domain": "py", "role": "class", "priority": "1", "uri": "api/Likelihood.html#bambi.Likelihood", "dispname": "-"}, {"name": "bambi.families.likelihood.Likelihood", "domain": "py", "role": "class", "priority": "1", "uri": "api/Likelihood.html#bambi.Likelihood", "dispname": "bambi.Likelihood"}, {"name": "bambi.Link", "domain": "py", "role": "class", "priority": "1", "uri": "api/Link.html#bambi.Link", "dispname": "-"}, {"name": "bambi.families.link.Link", "domain": "py", "role": "class", "priority": "1", "uri": "api/Link.html#bambi.Link", "dispname": "bambi.Link"}, {"name": "bambi.interpret.plot_comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_comparisons.html#bambi.interpret.plot_comparisons", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_comparisons.html#bambi.interpret.plot_comparisons", "dispname": "bambi.interpret.plot_comparisons"}, {"name": "bambi.interpret.plot_predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_predictions.html#bambi.interpret.plot_predictions", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_predictions.html#bambi.interpret.plot_predictions", "dispname": "bambi.interpret.plot_predictions"}, {"name": "bambi.interpret.plot_slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_slopes.html#bambi.interpret.plot_slopes", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_slopes.html#bambi.interpret.plot_slopes", "dispname": "bambi.interpret.plot_slopes"}, {"name": "bambi.interpret.comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.comparisons.html#bambi.interpret.comparisons", "dispname": "-"}, {"name": "bambi.interpret.effects.comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.comparisons.html#bambi.interpret.comparisons", "dispname": "bambi.interpret.comparisons"}, {"name": "bambi.interpret.predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.predictions.html#bambi.interpret.predictions", "dispname": "-"}, {"name": "bambi.interpret.effects.predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.predictions.html#bambi.interpret.predictions", "dispname": "bambi.interpret.predictions"}, {"name": "bambi.interpret.slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.slopes.html#bambi.interpret.slopes", "dispname": "-"}, {"name": "bambi.interpret.effects.slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.slopes.html#bambi.interpret.slopes", "dispname": "bambi.interpret.slopes"}, {"name": "bambi.clear_data_home", "domain": "py", "role": "function", "priority": "1", "uri": "api/clear_data_home.html#bambi.clear_data_home", "dispname": "-"}, {"name": "bambi.data.datasets.clear_data_home", "domain": "py", "role": "function", "priority": "1", "uri": "api/clear_data_home.html#bambi.clear_data_home", "dispname": "bambi.clear_data_home"}, {"name": "bambi.load_data", "domain": "py", "role": "function", "priority": "1", "uri": "api/load_data.html#bambi.load_data", "dispname": "-"}, {"name": "bambi.data.datasets.load_data", "domain": "py", "role": "function", "priority": "1", "uri": "api/load_data.html#bambi.load_data", "dispname": "bambi.load_data"}]} \ No newline at end of file +{"project": "bambi", "version": "0.0.9999", "count": 62, "items": [{"name": "bambi.Model.build", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.build", "dispname": "-"}, {"name": "bambi.models.Model.build", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.build", "dispname": "bambi.Model.build"}, {"name": "bambi.Model.compute_log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.compute_log_likelihood", "dispname": "-"}, {"name": "bambi.models.Model.compute_log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.compute_log_likelihood", "dispname": "bambi.Model.compute_log_likelihood"}, {"name": "bambi.Model.fit", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.fit", "dispname": "-"}, {"name": "bambi.models.Model.fit", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.fit", "dispname": "bambi.Model.fit"}, {"name": "bambi.Model.graph", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.graph", "dispname": "-"}, {"name": "bambi.models.Model.graph", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.graph", "dispname": "bambi.Model.graph"}, {"name": "bambi.Model.plot_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.plot_priors", "dispname": "-"}, {"name": "bambi.models.Model.plot_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.plot_priors", "dispname": "bambi.Model.plot_priors"}, {"name": "bambi.Model.predict", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.predict", "dispname": "-"}, {"name": "bambi.models.Model.predict", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.predict", "dispname": "bambi.Model.predict"}, {"name": "bambi.Model.prior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.prior_predictive", "dispname": "-"}, {"name": "bambi.models.Model.prior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.prior_predictive", "dispname": "bambi.Model.prior_predictive"}, {"name": "bambi.Model.set_alias", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_alias", "dispname": "-"}, {"name": "bambi.models.Model.set_alias", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_alias", "dispname": "bambi.Model.set_alias"}, {"name": "bambi.Model.set_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_priors", "dispname": "-"}, {"name": "bambi.models.Model.set_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Model.html#bambi.Model.set_priors", "dispname": "bambi.Model.set_priors"}, {"name": "bambi.Model", "domain": "py", "role": "class", "priority": "1", "uri": "api/Model.html#bambi.Model", "dispname": "-"}, {"name": "bambi.models.Model", "domain": "py", "role": "class", "priority": "1", "uri": "api/Model.html#bambi.Model", "dispname": "bambi.Model"}, {"name": "bambi.Formula.check_additional", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additional", "dispname": "-"}, {"name": "bambi.formula.Formula.check_additional", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additional", "dispname": "bambi.Formula.check_additional"}, {"name": "bambi.Formula.check_additionals", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additionals", "dispname": "-"}, {"name": "bambi.formula.Formula.check_additionals", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.check_additionals", "dispname": "bambi.Formula.check_additionals"}, {"name": "bambi.Formula.get_all_formulas", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.get_all_formulas", "dispname": "-"}, {"name": "bambi.formula.Formula.get_all_formulas", "domain": "py", "role": "function", "priority": "1", "uri": "api/Formula.html#bambi.Formula.get_all_formulas", "dispname": "bambi.Formula.get_all_formulas"}, {"name": "bambi.Formula", "domain": "py", "role": "class", "priority": "1", "uri": "api/Formula.html#bambi.Formula", "dispname": "-"}, {"name": "bambi.formula.Formula", "domain": "py", "role": "class", "priority": "1", "uri": "api/Formula.html#bambi.Formula", "dispname": "bambi.Formula"}, {"name": "bambi.Prior.update", "domain": "py", "role": "function", "priority": "1", "uri": "api/Prior.html#bambi.Prior.update", "dispname": "-"}, {"name": "bambi.priors.prior.Prior.update", "domain": "py", "role": "function", "priority": "1", "uri": "api/Prior.html#bambi.Prior.update", "dispname": "bambi.Prior.update"}, {"name": "bambi.Prior", "domain": "py", "role": "class", "priority": "1", "uri": "api/Prior.html#bambi.Prior", "dispname": "-"}, {"name": "bambi.priors.prior.Prior", "domain": "py", "role": "class", "priority": "1", "uri": "api/Prior.html#bambi.Prior", "dispname": "bambi.Prior"}, {"name": "bambi.Family.auxiliary_parameters", "domain": "py", "role": "attribute", "priority": "1", "uri": "api/Family.html#bambi.Family.auxiliary_parameters", "dispname": "-"}, {"name": "bambi.families.family.Family.auxiliary_parameters", "domain": "py", "role": "attribute", "priority": "1", "uri": "api/Family.html#bambi.Family.auxiliary_parameters", "dispname": "bambi.Family.auxiliary_parameters"}, {"name": "bambi.Family.log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.log_likelihood", "dispname": "-"}, {"name": "bambi.families.family.Family.log_likelihood", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.log_likelihood", "dispname": "bambi.Family.log_likelihood"}, {"name": "bambi.Family.posterior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.posterior_predictive", "dispname": "-"}, {"name": "bambi.families.family.Family.posterior_predictive", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.posterior_predictive", "dispname": "bambi.Family.posterior_predictive"}, {"name": "bambi.Family.set_default_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.set_default_priors", "dispname": "-"}, {"name": "bambi.families.family.Family.set_default_priors", "domain": "py", "role": "function", "priority": "1", "uri": "api/Family.html#bambi.Family.set_default_priors", "dispname": "bambi.Family.set_default_priors"}, {"name": "bambi.Family", "domain": "py", "role": "class", "priority": "1", "uri": "api/Family.html#bambi.Family", "dispname": "-"}, {"name": "bambi.families.family.Family", "domain": "py", "role": "class", "priority": "1", "uri": "api/Family.html#bambi.Family", "dispname": "bambi.Family"}, {"name": "bambi.Likelihood", "domain": "py", "role": "class", "priority": "1", "uri": "api/Likelihood.html#bambi.Likelihood", "dispname": "-"}, {"name": "bambi.families.likelihood.Likelihood", "domain": "py", "role": "class", "priority": "1", "uri": "api/Likelihood.html#bambi.Likelihood", "dispname": "bambi.Likelihood"}, {"name": "bambi.Link", "domain": "py", "role": "class", "priority": "1", "uri": "api/Link.html#bambi.Link", "dispname": "-"}, {"name": "bambi.families.link.Link", "domain": "py", "role": "class", "priority": "1", "uri": "api/Link.html#bambi.Link", "dispname": "bambi.Link"}, {"name": "bambi.interpret.plot_comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_comparisons.html#bambi.interpret.plot_comparisons", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_comparisons.html#bambi.interpret.plot_comparisons", "dispname": "bambi.interpret.plot_comparisons"}, {"name": "bambi.interpret.plot_predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_predictions.html#bambi.interpret.plot_predictions", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_predictions.html#bambi.interpret.plot_predictions", "dispname": "bambi.interpret.plot_predictions"}, {"name": "bambi.interpret.plot_slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_slopes.html#bambi.interpret.plot_slopes", "dispname": "-"}, {"name": "bambi.interpret.plotting.plot_slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.plot_slopes.html#bambi.interpret.plot_slopes", "dispname": "bambi.interpret.plot_slopes"}, {"name": "bambi.interpret.comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.comparisons.html#bambi.interpret.comparisons", "dispname": "-"}, {"name": "bambi.interpret.effects.comparisons", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.comparisons.html#bambi.interpret.comparisons", "dispname": "bambi.interpret.comparisons"}, {"name": "bambi.interpret.predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.predictions.html#bambi.interpret.predictions", "dispname": "-"}, {"name": "bambi.interpret.effects.predictions", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.predictions.html#bambi.interpret.predictions", "dispname": "bambi.interpret.predictions"}, {"name": "bambi.interpret.slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.slopes.html#bambi.interpret.slopes", "dispname": "-"}, {"name": "bambi.interpret.effects.slopes", "domain": "py", "role": "function", "priority": "1", "uri": "api/interpret.slopes.html#bambi.interpret.slopes", "dispname": "bambi.interpret.slopes"}, {"name": "bambi.clear_data_home", "domain": "py", "role": "function", "priority": "1", "uri": "api/clear_data_home.html#bambi.clear_data_home", "dispname": "-"}, {"name": "bambi.data.datasets.clear_data_home", "domain": "py", "role": "function", "priority": "1", "uri": "api/clear_data_home.html#bambi.clear_data_home", "dispname": "bambi.clear_data_home"}, {"name": "bambi.load_data", "domain": "py", "role": "function", "priority": "1", "uri": "api/load_data.html#bambi.load_data", "dispname": "-"}, {"name": "bambi.data.datasets.load_data", "domain": "py", "role": "function", "priority": "1", "uri": "api/load_data.html#bambi.load_data", "dispname": "bambi.load_data"}]} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7d03b483d..c127668a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dev = [ "pylint==3.1.0", "pytest-cov>=2.6.1", "pytest>=4.4.0", - "quartodoc==0.6.1", + "quartodoc==0.9.1", "seaborn>=0.9.0", ]