Prerequisites
The instructions below assume you are following best practices and have downloaded this git repo into a parent directory at: ~/atai. If you have already installed the ATAI Python Library and cloned the cookbook repository, proceed directly to Quickstart.Before proceeding, check the requirements and correct Python version for the ATAI Python Library. To upgrade your Python client settings, please check our Python Client library.
Install Conda
Setup dev environment
Install ATAI Python Library
Clone Cookbook Repository
Quick Start
Analyze time-series sensor data to classify machine states using few-shot learning with example patterns.Running the Demo
From the cookbook root directory with your conda environment activated:Sample CSV files are provided in the
sample_files/ directory, including a data file and example focus files for testing the demo.Interactive Prompts
- API Endpoint: Your ArchetypeAI API endpoint (press Enter to use the default)
- Data File: Path to the CSV file containing sensor data to analyze
- Focus Files: Paths to example CSV files for each state you want to classify. Type
donewhen finished adding files. - Window Size: Number of data points per analysis window (default: 1024)
- Step Size: Number of data points to advance between windows (default: same as window size)
Example Session
Sample Data
The demo includes sample files in thesample_files/ directory:
data.csv- Sensor data to analyzefocus/healthy.csv- Example of healthy machine statefocus/broken.csv- Example of broken machine state
Classification Tips
Naming Convention
Class names are automatically derived from focus file names:healthy.csvcreates class “healthy”broken.csvcreates class “broken”normal_operation.csvcreates class “normal_operation”
Window Size Configuration
The window size parameter determines how many data points Newton analyzes in each inference cycle. This affects the granularity of state classification.Recommended Settings
| Setting | Value | Use Case |
|---|---|---|
| Default | 1024 | Optimal for most scenarios |
| High-frequency sensors (above 100Hz) | 256–512 | Finer granularity for fast-sampling data |
| Low-frequency sensors (below 10Hz) | 64–128 | Appropriate window for slower data |
| Maximum | 1024 | Upper limit for window size |
How It Works
Each window represents a time segment of sensor data. The system compares these windows against your focus examples to classify the machine state. Non-overlapping windows (step size = window size) provide independent classifications, while overlapping windows offer smoother state transitions.Constraints
- Window size cannot exceed the length of your shortest focus file
- Minimum window size is 16 data points for meaningful analysis