RAI Utils
raw JSON → 0.4.2 verified Fri May 01 auth: no python
Common basic utilities used across various Responsible AI tools from Microsoft, including raiwidgets and responsibleai. Version 0.4.2, released as part of the responsible-ai-toolbox monorepo. Package is maintained alongside the broader toolbox, with occasional patches.
pip install raiutils Common errors
error ModuleNotFoundError: No module named 'raiutils' ↓
cause raiutils is not installed or the environment is missing it.
fix
Run 'pip install raiutils'
error AttributeError: module 'raiutils' has no attribute 'validate_dataset' ↓
cause Direct import of raiutils does not include submodules; you must import the specific module.
fix
Use 'from raiutils.data_processing import validate_dataset'
Warnings
gotcha raiutils is not intended to be used standalone; it is a dependency for raiwidgets and responsibleai. Direct use of internal APIs may break without notice. ↓
fix Only import raiutils modules that are documented or used by the higher-level packages.
gotcha The package version is not aligned with the main toolbox releases. raiutils 0.4.2 may be used with a range of raiwidgets/responsibleai versions. ↓
fix Check compatibility with your specific raiwidgets/responsibleai version by verifying the toolbox release notes.
gotcha Some utility functions may have been moved or renamed in more recent toolbox versions. Always refer to the source code or documentation of the exact toolbox version you are using. ↓
fix Pin versions and test after upgrading the responsible-ai-toolbox.
Imports
- raiutils
import raiutils
Quickstart
import raiutils
# Check if a dataset is valid
from raiutils.data_processing import validate_dataset
import pandas as pd
df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]})
validate_dataset(df, target_column='a')
print('Dataset validation passed')