Skip to main content
synthefy and synthefy-nori are two different packages. synthefy-nori is the model; synthefy is the client that calls it. This page covers the client. Its one class, SynthefyNoriClient, runs the same predict call against the hosted endpoint or against a local copy of the model, so you can develop on your machine and ship to the API without changing the call.

One call, either backend

mode="remote" uses the hosted API, mode="local" runs in-process, and mode="auto" picks whichever is available.

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.

More options than these

predict also accepts text columns (needs pip install "synthefy[text]") and discrete-target snapping. See the docstring in nori_client.py.

Retries built in

Timeouts, connection errors, 429s and 5xx are retried with exponential backoff.
Use this page when you want the hosted API, or one code path that works both ways. To run the open-source model directly with no client in between, use NoriRegressor from synthefy-nori instead.

Quickstart

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".
"auto" resolves at construction, and the resolved value is readable on client.mode, so you can log which backend you actually got.

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.
Non-numeric columns are encoded, fit on X_train and applied to X_test:
  • Default (categorical_encoding="ordinal") — each categorical column becomes one column of integer codes, from X_train’s categories in sorted order. A value seen only in X_test maps to -1; missing stays NaN and is imputed server-side.
  • categorical_encoding="onehot" — one indicator column per category, and missing values get their own indicator.
  • max_categorical_cardinality (default 100) 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

Next steps

API key

Create the key this client authenticates with.

Quickstart

The model sizes, and running the model directly without the client.