CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pymc3

Probabilistic Programming in Python: Bayesian Modeling and Probabilistic Machine Learning with Theano

Agent Success

Agent success rate when using this tile

68%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.94x

Baseline

Agent success rate without this tile

72%

Overview
Eval results
Files

task.mdevals/scenario-10/

Campaign Response Model

Construct a probabilistic model for segmented conversion data using distributions, deterministic transforms, and a penalty potential to reflect a target overall conversion rate.

Capabilities

Build model with segment offsets

  • Given exposures [50, 60, 40], conversions [5, 9, 4], segments ["organic", "organic", "paid"], target_overall_rate=0.1, and penalty_scale=2.0, builds a probabilistic model containing a baseline log-odds prior, a segment offset vector sized to the distinct segment identifiers, a deterministic per-row conversion rate using a logistic transform of the baseline plus the corresponding segment offset, and an observed likelihood tying conversions to exposures using the per-row rates. @test

Deterministic summaries

  • Exposes deterministic segment_rate_<name> values for each unique segment equal to the logistic transform of the baseline plus that segment's offset, along with a deterministic overall_rate equal to the exposure-weighted average of the per-row conversion rates. @test

Target penalty potential

  • Adds a log-density penalty proportional to -penalty_scale * (overall_rate - target_overall_rate) ** 2 so that large deviations from the target reduce model probability; applies even when the target rate is near 0 or 1. @test

Implementation

@generates

API

from typing import Sequence, Any

def build_response_model(
    exposures: Sequence[int],
    conversions: Sequence[int],
    segment_ids: Sequence[str],
    target_overall_rate: float,
    penalty_scale: float = 2.0,
) -> Any:
    """Return a probabilistic model constructed with the dependency package. Model must contain named random variables, deterministics, and a potential penalty."""

Dependencies { .dependencies }

pymc { .dependency }

Probabilistic programming library for defining models with random variables, deterministics, and potentials.

tile.json