Docs /Templates/ sinapsis-data-readers

CSVDatasetSplitter

sinapsis-data-readerscommunity

Python template · sinapsis_data_readers.templates.datasets_readers.dataset_splitter

Overview

Template to split a tabular data set into test and train samples. The template retrieves the dataset from the dataframe packet of the container and stores the features and targets as new dataframes, with source indicating whether train or test samples

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-data-readers==1.0.0
uv pip install sinapsis-data-readers==1.0.0
uv add sinapsis-data-readers==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata

Field used to set the template instance name and agent name. Defaults to None.

sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
target_key
str
Optional
Default: "target"
train_size
float
Optional
Default: 0.2
feature_key
str | None
Optional
Default: null
random_state
int
Optional
Default: 42

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "CSVDatasetSplitter"
    class_name: "CSVDatasetSplitter"
    attributes:
      target_key: "target"
      train_size: 0.2
      feature_key: null
      random_state: 42

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.