Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "validmind"
version = "2.10.4"
version = "2.10.5"
description = "ValidMind Library"
readme = "README.pypi.md"
requires-python = ">=3.9,<3.13"
Expand Down
2 changes: 1 addition & 1 deletion validmind/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.10.4"
__version__ = "2.10.5"
9 changes: 8 additions & 1 deletion validmind/ai/test_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
import os
from concurrent.futures import ThreadPoolExecutor
from typing import List, Optional, Union
from typing import Any, Dict, List, Optional, Union

import tiktoken

Expand Down Expand Up @@ -76,6 +76,7 @@ def generate_description(
title: Optional[str] = None,
instructions: Optional[str] = None,
additional_context: Optional[str] = None,
params: Optional[Dict[str, Any]] = None,
):
"""Generate the description for the test results."""
from validmind.api_client import generate_test_result_description
Expand Down Expand Up @@ -124,6 +125,7 @@ def generate_description(
"figures": [figure._get_b64_url() for figure in figures or []],
"additional_context": additional_context,
"instructions": instructions,
"params": params,
}
)["content"]

Expand All @@ -137,6 +139,7 @@ def background_generate_description(
title: Optional[str] = None,
instructions: Optional[str] = None,
additional_context: Optional[str] = None,
params: Optional[Dict[str, Any]] = None,
):
def wrapped():
try:
Expand All @@ -150,6 +153,7 @@ def wrapped():
title=title,
instructions=instructions,
additional_context=additional_context,
params=params,
),
True,
)
Expand Down Expand Up @@ -181,6 +185,7 @@ def get_result_description(
title: Optional[str] = None,
instructions: Optional[str] = None,
additional_context: Optional[str] = None,
params: Optional[Dict[str, Any]] = None,
):
"""Get the metadata dictionary for a test or metric result.

Expand All @@ -204,6 +209,7 @@ def get_result_description(
should_generate (bool): Whether to generate the description or not. Defaults to True.
instructions (Optional[str]): Instructions for the LLM to generate the description.
additional_context (Optional[str]): Additional context for the LLM to generate the description.
params (Optional[Dict[str, Any]]): Test parameters used to customize test behavior.

Returns:
str: The description to be logged with the test results.
Expand Down Expand Up @@ -232,6 +238,7 @@ def get_result_description(
title=title,
instructions=_instructions,
additional_context=additional_context,
params=params,
)

else:
Expand Down
4 changes: 2 additions & 2 deletions validmind/tests/data_validation/TooManyZeroValues.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def TooManyZeroValues(
The 'TooManyZeroValues' test is utilized to identify numerical columns in the dataset that may present a quantity
of zero values considered excessive. The aim is to detect situations where these may implicate data sparsity or a
lack of variation, limiting their effectiveness within a machine learning model. The definition of 'too many' is
quantified as a percentage of total values, with a default set to 3%.
quantified as a percentage of total values, with a default set to 0.03%.

### Test Mechanism

This test is conducted by looping through each column in the dataset and categorizing those that pertain to
numerical data. On identifying a numerical column, the function computes the total quantity of zero values and
their ratio to the total row count. Should the proportion exceed a pre-set threshold parameter, set by default at
0.03 or 3%, the column is considered to have failed the test. The results for each column are summarized and
0.03%, the column is considered to have failed the test. The results for each column are summarized and
reported, indicating the count and percentage of zero values for each numerical column, alongside a status
indicating whether the column has passed or failed the test.

Expand Down
1 change: 1 addition & 0 deletions validmind/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ def run_test( # noqa: C901
title=title,
instructions=instructions,
additional_context=additional_context,
params=result.params,
)

if show:
Expand Down