mlclient

package
v0.0.0-...-b5bd0e7 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStorage

type CacheStorage interface {
	Get(ctx context.Context, key string, v interface{}) error
	Set(ctx context.Context, key string, v interface{}) error
}

type FileStore

type FileStore interface {
	Load(ctx context.Context, path string) ([]byte, error)
	Save(ctx context.Context, path string, content []byte) error
}

type HttpClientMaker

type HttpClientMaker interface {
	MakeClient(ctx context.Context) (*http.Client, error)
}

type PersistentStore

type PersistentStore interface {
	Get(ctx context.Context, kind, key string, v interface{}) ([]data.Property, error)
	Set(ctx context.Context, kind, key string, properties []data.Property, v interface{}) error
	Transact(ctx context.Context, f func(ctx context.Context) error) error
}

type PredictionMaker

type PredictionMaker struct {
	CacheStorage    CacheStorage
	HttpClientMaker HttpClientMaker
}

func (*PredictionMaker) Predict

func (pm *PredictionMaker) Predict(ctx context.Context, predictions []float64) (p float64, err error)

type PredictionSource

type PredictionSource interface {
	AllPredictionsSince(ctx context.Context, t time.Time) ([]*predictions.PredictionSummary, error)
	AllPredictionResponses(context.Context, []*predictions.PredictionSummary) ([]*predictions.PredictionSummary, []*predictions.PredictionResponse, error)
}

type Trainer

type Trainer struct {
	PersistentStore  PersistentStore
	FileStore        FileStore
	PredictionSource PredictionSource
	ModelPath        string
	DataPath         string
	TrainPackage     string
	SleepFunc        func(time.Duration)
	HttpClientMaker  HttpClientMaker
}

func (*Trainer) Retrain

func (tr *Trainer) Retrain(ctx context.Context, now time.Time) error

Jump to

Keyboard shortcuts

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