inference

package
v2.55.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package inference has the cross language implementation of RunInference API implemented in Python SDK. An expansion service for python external transforms can be started by running

$ python -m apache_beam.runners.portability.expansion_service_main -p $PORT_FOR_EXPANSION_SERVICE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SklearnModel

func SklearnModel(modelURI string, opts ...sklearnConfig) sklearn

SklearnModel configures the parameters required to perform RunInference transform on Sklearn Model. It returns an sklearn object which should be used to call RunInference transform. ModelURI is the required parameter indicating the path to the sklearn model.

Example:
  modelURI := "gs://storage/model"
  model := inference.SklearnModel(modelURI)
  prediction := model.RunInference(s, input, inference.WithExpansionAddr("localhost:9000"))

func WithArgs

func WithArgs(args []string) runInferenceOption

WithArgs set arguments for the RunInference transform parameters.

func WithExpansionAddr

func WithExpansionAddr(expansionAddr string) runInferenceOption

WithExpansionAddr provides URL for Python expansion service.

func WithExtraPackages

func WithExtraPackages(extraPackages []string) runInferenceOption

WithExtraPackages is used to specify additional packages when using an automated expansion service. Packages required to run the required Model are included implicitly, eg: scikit-learn, pandas for Sklearn Model Handler.

Types

type PredictionResult

type PredictionResult struct {
	Example   []int64 `beam:"example"`
	Inference int32   `beam:"inference"`
}

PredictionResult represents the result of a prediction obtained from Python's RunInference API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL