Linux Deployment Code Examples
Prepare AdventureWorks data to explore Kumo’s local modeling workflow on Linux. It contains customers, products, order headers, and order details.
The Train a Classification Model tab uses IBM’s synthetic AML transaction data instead. Its instructions name the three LI-Medium source files and prepare them separately; the AdventureWorks bundle below applies to the other Linux examples.
Prepare the Input Files
Complete Linux Machine Deployment Setup and activate the same Python environment.
Keep KUMO_SCRATCH set to your writable directory on local storage.
Download the Linux examples bundle, containing the data preparation scripts, task scripts, checksums, and a README. The bundle contains no Kumo packages, datasets, models, or credentials.
From the directory where you saved the ZIP, extract it and verify its files:
Every file should report OK. The checksums detect changed files; they do not authenticate the publisher.
The downloader reads the official AdventureWorks OLTP extracts from Microsoft’s
sql-server-samples repository and verifies their pinned SHA-256 hashes.
It uses the Python standard library and does not configure a Kumo connector.
Choose two new, separate directories. Replace the paths with your source-download and prepared-input locations:
The downloader verifies the four files against fixed SHA-256 checksums before accepting the download. It refuses an existing destination and reports access, network, or checksum failures without replacing prior files. The preparation script checks schemas and relationships, then creates independent copies. The graph example below reads those local copies.
The prepared directory contains these files:
Customer, product, order, and order-detail primary keys must be nonempty and unique. Order headers reference customers. The preparation script copies the validated header customer identifier onto each order detail. Order details reference customers, order headers, and products. Dates are timezone-free values.
Keep ADVENTUREWORKS_DATA set to the prepared directory for the graph and task examples.
Keep the source files unchanged while running the example. The procedure below builds a snapshot from their current contents.
Build the AdventureWorks Graph
Run the following Python blocks in order in one process after setting ADVENTUREWORKS_DATA and KUMO_SCRATCH.
Keep input and scratch directories separate.
For the API concepts, see Tables and Graphs.
The two order tables use explicit date types. The walkthrough treats
SalesOrderDetail.ModifiedDate as the detail availability time.
Connect the four tables and materialize the snapshot:
Expect Customer, Product, SalesOrderHeader, and SalesOrderDetail in the table list.
The completed call returns a snapshot ID and local index directory.
Keep graph, snapshot, and input_dir available when continuing in the same Python process.
For unchanged files, a repeated snapshot request should reuse the same index:
Resolve Data Preparation Problems
Continue to Modeling
Use Predictive Queries to choose a target and generate training rows, then Training to fit a model. This example focuses on the workflow. Evaluate model quality on data and metrics that represent your use case.
Use Making Predictions and Publish and Retrieve Models to inspect and save outputs, retain model bundles, and load them in another process.