model

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TENSORFLOW is the mode type that trained by TensorFlow.
	TENSORFLOW = iota
	// XGBOOST is the model type that trained by XGBoost models.
	XGBOOST
	// PAIML is the model type that trained by PAI machine learning algorithm toolkit
	PAIML
)

Variables

This section is empty.

Functions

func DumpDBModel

func DumpDBModel(db *database.DB, table, cwd string) (string, error)

DumpDBModel dumps a model tarball from database to local file system and return the file name

func MockInDB

func MockInDB(cwd, trainSelect, table string) error

MockInDB mocks a model meta structure which saved in database for testing

Types

type Model

type Model struct {
	TrainSelect string           // TrainSelect is gob-encoded during I/O.
	Meta        *simplejson.Json // Meta json object
	// contains filtered or unexported fields
}

Model represent a trained model, which could be saved to a filesystem or sqlfs.

func ExtractMetaFromTarball

func ExtractMetaFromTarball(tarballName, cwd string) (*Model, error)

ExtractMetaFromTarball extract metadata from given tarball and return the metadata json string. This function do not unzip the whole model tarball

func Load

func Load(modelURI, dst string, db *database.DB) (*Model, error)

Load unzip a saved model to a directory on the local filesystem. When dst=="", we do not unzip model data, just extract the model meta

func New

func New(cwd, trainSelect string) *Model

New an empty model.

func (*Model) GetMetaAsString

func (m *Model) GetMetaAsString(key string) string

GetMetaAsString return specified metadata as string

func (*Model) Save

func (m *Model) Save(modelURI string, session *pb.Session) error

Save all files in workDir as a tarball to a filesystem or sqlfs.

Jump to

Keyboard shortcuts

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