validmind.customer_churn
get_demo_test_config
defget_demo_test_config(test_suite=None):
Returns input configuration for the default documentation template assigned to this demo model
The default documentation template uses the following inputs:
- raw_dataset
- train_dataset
- test_dataset
- model
We assign the following inputs depending on the input config expected by each test:
- When a test expects a "dataset" we use the raw_dataset
- When a tets expects "datasets" we use the train_dataset and test_dataset
- When a test expects a "model" we use the model
- When a test expects "model" and "dataset" we use the model and test_dataset
- The only exception is ClassifierPerformance since that runs twice: once with the train_dataset (in sample) and once with the test_dataset (out of sample)
get_demo_text_config
defget_demo_text_config() → Dict[str, Dict[str, Any]]:
Return text generation config for the customer churn demo.
The config is keyed by target content_id. Each entry describes how vm.run_text_generation() should populate that block.
Supported fields per content ID: - section_id (optional): Only needed when the content block does not already exist in the template and should be appended to a section. - prompt (optional): Per-block prompt override for generation. - context (optional): Context object passed through to vm.run_text_generation(). When present, it follows the same shape expected by the library, e.g. {"content_ids": [...]}.
Returns
- A previewable text-generation configuration dictionary for the customer churn documentation demo.
load_data
defload_data(full_dataset=False):
preprocess
defpreprocess(df):