schema
agentic_ml.data.schema
¶
Description and aggregate profiling of a tabular dataset.
Only aggregate information (dtypes, missing counts, cardinality, target summary) is ever exposed to the LLM. The raw data never leaves the machine through the prompt; it is only read by the code executed inside the sandbox.
DatasetSchema
dataclass
¶
DatasetSchema(variables: dict[str, str], target: str)
User-provided description of a dataset, driving both validation and prompting.
A schema is the only thing a user must supply about their data beyond the dataframe
itself. It is used to check the data has the expected columns (:meth:validate), to
compute the aggregate, LLM-safe profile shown to the agent (:meth:profile and
:meth:describe_for_prompt), and to split the dataframe into features/target inside
:func:~agentic_ml.core.engine.setup_research.
Attributes:
| Name | Type | Description |
|---|---|---|
variables |
dict[str, str]
|
Maps each column name to a short, natural-language description (e.g.
|
target |
str
|
The name of the column to predict. Every other column is treated as a
feature by :meth: |
feature_names
¶
feature_names(data: DataFrame) -> list[str]
Return every column of data except the target.
Source code in src/agentic_ml/data/schema.py
37 38 39 | |
validate
¶
validate(data: DataFrame) -> None
Check that the target and described variables exist in data.
Source code in src/agentic_ml/data/schema.py
41 42 43 44 45 46 47 | |
profile
¶
profile(data: DataFrame) -> dict
Compute an aggregate, LLM-safe profile of data.
Source code in src/agentic_ml/data/schema.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
describe_for_prompt
¶
describe_for_prompt(data: DataFrame) -> str
Render a compact textual description of the schema and profile for the prompt.
Source code in src/agentic_ml/data/schema.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |