diff --git a/pyproject.toml b/pyproject.toml index 0a2b3a989..bcb0c3801 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/validmind/__version__.py b/validmind/__version__.py index e3b571e0f..0d040b30c 100644 --- a/validmind/__version__.py +++ b/validmind/__version__.py @@ -1 +1 @@ -__version__ = "2.10.4" +__version__ = "2.10.5" diff --git a/validmind/ai/test_descriptions.py b/validmind/ai/test_descriptions.py index c26870239..3df47ac22 100644 --- a/validmind/ai/test_descriptions.py +++ b/validmind/ai/test_descriptions.py @@ -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 @@ -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 @@ -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"] @@ -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: @@ -150,6 +153,7 @@ def wrapped(): title=title, instructions=instructions, additional_context=additional_context, + params=params, ), True, ) @@ -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. @@ -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. @@ -232,6 +238,7 @@ def get_result_description( title=title, instructions=_instructions, additional_context=additional_context, + params=params, ) else: diff --git a/validmind/tests/data_validation/TooManyZeroValues.py b/validmind/tests/data_validation/TooManyZeroValues.py index adc04381d..98ae90974 100644 --- a/validmind/tests/data_validation/TooManyZeroValues.py +++ b/validmind/tests/data_validation/TooManyZeroValues.py @@ -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. diff --git a/validmind/tests/run.py b/validmind/tests/run.py index 3fd50059c..bd688affb 100644 --- a/validmind/tests/run.py +++ b/validmind/tests/run.py @@ -461,6 +461,7 @@ def run_test( # noqa: C901 title=title, instructions=instructions, additional_context=additional_context, + params=result.params, ) if show: