Skip to main content

datagoat

Ask typed questions about cases: yesno, score, choice and rank. Datagoat answers from what happened to cases like them. Every answered case comes back with a chance, the columns that moved it, and a signed Verdict. When the record can't support an answer, Datagoat refuses rather than guess.

pip install datagoat
datagoat signup      # a free test key for the sample records
datagoat sample      # ask about sample:saas_churn and verify the answer

Every call sends a record (past cases and their outcomes), questions, and the cases to answer:

from datagoat import Client, yesno, score

dg = Client()        # DATAGOAT_API_KEY, or the key `datagoat signup` saved
out = dg.ask(
    {"churn": yesno("churned", outcome_is_desirable=False),
     "risk":  score("churned", outcome_is_desirable=False)},
    dataset_id="sample:saas_churn", entity_column="customer_id", subject_kind="org",
    cases={"ids": ["cust_0001"]},
)
a = out["answers"]["churn"]
a["state"]                 # "answered" | "refused" | "not_yet": read it first
a["cases"][0]["p"]         # 0.7005: the chance cust_0001 churns
a["cases"][0]["reasons"]   # the columns that moved it, which way, and each value's band ("tenure_months 17 to under 26")
a["pattern"]               # where churn is most common ("support_tickets over 3", …)
a["cases"][0]["pattern_match"]  # {"matched": 3, "of": 4, "met": [...]}
dg.verify_all(out)         # True: every Verdict is genuine

Records that aren't one row per case take a shape: events, series, panel, signals, traces or snapshots.

Building a product for your own customers:

dg.suggest("customer_id", dataset_id="ds_…")          # which questions the table can answer
fit = dg.ask({"churn": yesno("churned", outcome_is_desirable=False)}, dataset_id="ds_…",
             entity_column="customer_id", subject_kind="org", cases={"ids": ["c1"]},
             namespace="acme", model_ttl_days=180)     # one namespace per customer
ref = fit["answers"]["churn"]["model_ref"]
dg.ask({"churn": from_model(ref)}, entity_column="customer_id", subject_kind="org",
       cases={"rows": new_rows})                       # no record, no fit
dg.extend_model(ref, 365); dg.delete_model(ref)

Guide: https://datagoat.io/docs/build

At volume: dg.ask_many(questions, cases={"ids": ids}, ...) asks about more than 10,000 cases in chunks on one fit and joins them in order; export="csv" on ask adds a CSV of every case (dg.download(out["export"]["results_url"], "results.csv")). The client retries rate limits and safe calls on its own.

Release files for datagoat 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datagoat 1.5.0
File Size Uploaded
datagoat-1.5.0.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datagoat 1.5.0
File Interpreter ABI Platform
datagoat-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / datagoat-1.5.0.tar.gz

Download URL datagoat-1.5.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ede6b2f3f4af9e02f35be7883285e4de46ae1a0a3cc8c5abe2f5cd455d24b6ae
BLAKE2b-256 checksum
How to use checksums
e9fe315f18478bb0def2b37ef05a879599e8a97b604daf341b5b20e5d77a3da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / datagoat-1.5.0-py3-none-any.whl

Download URL datagoat-1.5.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93b5c660b944a799ce7e5f486af6ae14017defab273c811e07562537ffd1ed95
BLAKE2b-256 checksum
How to use checksums
cdc357f895cab34614eb062c4b4a4ae7af838fd4f8abe269522023b6c8e3d915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page