synthefy is the lightweight client and workflow package. Install
synthefy-nori as well when you want to run the model locally. This page covers
SynthefyNoriClient.
Its one class, SynthefyNoriClient, runs the same predict call against the
hosted service, an Amazon SageMaker endpoint, or a local copy of the model.
One call, every backend
mode="remote" uses the hosted API, mode="sagemaker" uses your AWS
endpoint, and mode="local" runs in-process.Takes DataFrames
Hand it a
DataFrame and it aligns columns by name and encodes categoricals
for you, rather than making you build a numeric matrix.Joint targets
Pass a target matrix to predict related numeric outcomes together and draw
samples from their joint distribution.
Retries built in
Timeouts, connection errors, 429s and 5xx are retried with exponential
backoff.
Use this client when you want one API for hosted, SageMaker, and local
execution. Local mode requires
synthefy-nori; importing base synthefy stays
lightweight and never imports Torch. For the lower-level local estimator, use
NoriRegressor from the quickstart.Quickstart
Install the appropriate distribution from the installation guide, then get a key from the API key guide.predict returns one float per row of X_test, in order. Pass as_pandas=True
to get a pandas.Series instead.
Choosing a mode
mode decides where the model runs. It defaults to "remote".
Choose the mode deliberately. The client never switches because it found local
packages or ambient credentials. Change only
mode and its backend-specific
configuration when promoting the same workflow:
Predicting from DataFrames
Pass DataFrames and the client builds the numeric matrix for you.X_test is
aligned to X_train by column name, so column order does not matter; a
mismatch in the column sets raises.
X_train and applied to X_test:
- Default (
categorical_encoding="ordinal") — each categorical column becomes one column of integer codes, fromX_train’s categories in sorted order. A value seen only inX_testmaps to-1; missing staysNaNand is imputed server-side. categorical_encoding="onehot"— one indicator column per category, and missing values get their own indicator.max_categorical_cardinality(default100) caps how many distinct values a categorical column may have. Above it the column is dropped, with a warning telling you to encode it yourself.
Configuration
Constructor parameters
Constructor parameters
predict parameters
predict parameters
Next steps
API key
Create the key this client authenticates with.
Quickstart
The model sizes, and running the model directly without the client.