rikai.sklearn package

Submodules

rikai.sklearn.models module

class rikai.sklearn.models.Classification

Bases: SklearnModelType

Classification model type

predict(x, *args, **kwargs) dict

Run model inference and convert return types into Rikai-compatible types.

schema() str

Return the string value of model schema.

Examples

>>> model_type.schema()
... "array<struct<box:box2d, score:float, label_id:int>>"
class rikai.sklearn.models.DimensionalityReduction

Bases: SklearnModelType

Dimensionality reduction models.

  • PCA

predict(x, *args, **kwargs) List[float]

Run model inference and convert return types into Rikai-compatible types.

schema() str

Return the string value of model schema.

Examples

>>> model_type.schema()
... "array<struct<box:box2d, score:float, label_id:int>>"
class rikai.sklearn.models.Regression

Bases: SklearnModelType

predict(x, *args, **kwargs) float

Run model inference and convert return types into Rikai-compatible types.

schema() str

Return the string value of model schema.

Examples

>>> model_type.schema()
... "array<struct<box:box2d, score:float, label_id:int>>"
class rikai.sklearn.models.SklearnModelType

Bases: ModelType, ABC

Base ModelType for Sklearn

load_model(spec: ModelSpec, **kwargs)

Lazy loading the model from a ModelSpec.

transform() Callable

A callable to pre-process the data before calling inference.

It will be feed into torch.data.DataLoader or tensorflow.data.Dataset.map().

Module contents