pdstools.utils.datasets

Attributes

Functions

cdh_sample(→ pdstools.adm.ADMDatamart.ADMDatamart)

Import a sample dataset from the CDH Sample application

sample_trees()

Load the anonymized AGB sample model (100 trees, with sampleCount).

sample_value_finder(...)

Import a sample dataset of a Value Finder simulation

sample_explanations(→ pdstools.explanations.Explanations)

Import a sample set of pre-aggregated AGB global explanations.

dq_sample(→ pdstools.data_quality.TopicDataQuality)

Load the built-in smalltalk sample dataset for Topic Data Quality.

Module Contents

ADMTreesModel = None
cdh_sample(query: pdstools.utils.types.QUERY | None = None) pdstools.adm.ADMDatamart.ADMDatamart

Import a sample dataset from the CDH Sample application

Parameters:

query (QUERY | None, optional) – An optional query to apply to the data, by default None

Returns:

The ADM Datamart class populated with CDH Sample data

Return type:

ADMDatamart

sample_trees()

Load the anonymized AGB sample model (100 trees, with sampleCount).

Returns:

An ADMTreesModel loaded from the bundled data/agb/ModelExportWithSampleCount.json file (dev environment) or from the canonical GitHub raw URL (installed package).

Return type:

ADMTreesModel

sample_value_finder(threshold: float | None = None) pdstools.valuefinder.ValueFinder.ValueFinder

Import a sample dataset of a Value Finder simulation

This simulation was ran on a stock CDH Sample system.

Parameters:

threshold (float | None, optional) – Optional override of the propensity threshold in the system, by default None

Returns:

The Value Finder class populated with the Value Finder simulation data

Return type:

ValueFinder

sample_explanations(*, model_name: str = 'AdaptiveBoostCT', from_date: datetime.datetime | None = None, to_date: datetime.datetime | None = None) pdstools.explanations.Explanations

Import a sample set of pre-aggregated AGB global explanations.

These were generated from a stock CDH Sample system. The aggregates are fetched from the pdstools repository over HTTPS, so this works from an installed package as well as from a repository checkout.

Parameters:
  • model_name (str, keyword-only, default "AdaptiveBoostCT") – Name of the model rule. Used for report metadata only.

  • from_date (datetime | None, keyword-only, optional) – Start of the reporting window. Defaults to a week before to_date.

  • to_date (datetime | None, keyword-only, optional) – End of the reporting window. Defaults to today.

Returns:

The Explanations class populated with the sample aggregates.

Return type:

Explanations

dq_sample(*, similarity_threshold: float = 0.8) pdstools.data_quality.TopicDataQuality

Load the built-in smalltalk sample dataset for Topic Data Quality.

Returns a ready-to-use TopicDataQuality instance with embeddings, UMAP, and similarity already computed.

Parameters:

similarity_threshold (float, default 0.8) – Topic pairs above this TF-IDF cosine similarity are flagged.

Returns:

A fully-initialized instance with precomputed results.

Return type:

TopicDataQuality