Seldon

class Seldon(api_key=None, *, host=None, dataset_name='dataset', model='seldon-small', strategy=None, memory_optimization=None, preprocess=True, n_groups=None, column_names=None, selected_features=None, timeout_s=900, metadata=None, user=None, api_version=None, default_headers=None)

Convenience wrapper that dispatches to SeldonClassifier or SeldonRegressor based on the target variable at fit time.

Warning

Seldon is NOT a scikit-learn estimator.

It cannot be used with sklearn utilities such as Pipeline, cross_val_score, GridSearchCV, or any API that relies on clone(), get_params(), or set_params().

This is intentional. Because Seldon determines whether the task is classification or regression during fit, it is incompatible with sklearn’s static estimator contract.

For sklearn integration, use SeldonClassifier or SeldonRegressor directly.

Parameters:
  • *args – Positional arguments forwarded unchanged to the underlying estimator constructor.

  • **kwargs

    Keyword arguments forwarded unchanged to either SeldonClassifier or SeldonRegressor.

    Supported parameters are identical to those accepted by those classes, except that memory_optimization defaults to None. When left as None, the value is selected automatically:

    • False for classification tasks

    • True for regression tasks

  • api_key (str | None)

  • host (str | None)

  • dataset_name (str)

  • model (str)

  • strategy (str | None)

  • memory_optimization (bool | None)

  • preprocess (bool)

  • n_groups (int | None)

  • column_names (List[str] | None)

  • selected_features (List[str] | None)

  • timeout_s (int)

  • metadata (Dict[str, Any] | None)

  • user (str | None)

  • api_version (str | None)

  • default_headers (Dict[str, str] | None)

Notes

Parameter validation is deferred until fit, once the task type has been determined.

Examples

Standalone usage (works):

>>> from neuralk import Seldon
>>> model = Seldon(api_key="nk_live_xxxx")
>>> model.fit(X_train, y_train)  # auto-detects task type
>>> predictions = model.predict(X_test)

Sklearn usage (does NOT work — raises TypeError):

>>> from sklearn.model_selection import cross_val_score
>>> cross_val_score(Seldon(...), X, y)  # TypeError