Documentation ¶
Index ¶
- func AuthorizationKey(ctx context.Context, token string) *datastore.Key
- func ClientResourceKey(ctx context.Context, clientID string) *datastore.Key
- func CreateClientAndAuthentication(ctx context.Context, clientID, clientSecret, scope, token string) error
- func CreateDefaultExport(ctx context.Context, clientID string) (*types.ExportDS, error)
- func CreateDefaultModel(ctx context.Context, clientID string) (*types.ModelDS, error)
- func CreateExport(ctx context.Context, clientID, event string) (*types.ExportDS, error)
- func ExportEvents(ctx context.Context, exportID string) (int, error)
- func ExportKey(ctx context.Context, clientID, event string) *datastore.Key
- func GetAuthorization(ctx context.Context, token string) (*types.AuthorizationDS, error)
- func GetEvents(ctx context.Context, clientID, event string, start, end int64, page, limit int) (*[]types.EventDS, error)
- func GetExport(ctx context.Context, clientID, event string) (*types.ExportDS, error)
- func GetModel(ctx context.Context, clientID, name string) (*types.ModelDS, error)
- func GetPrediction(ctx context.Context, clientID, name, id, entityType, targetEntityType string, ...) (*api.Prediction, error)
- func ImportPredictions(ctx context.Context, jobID string) error
- func InvokeFunction(ctx context.Context, function, reqID string, payload interface{}) (int, *types.GenericResponse)
- func MarkModelTrainingDone(ctx context.Context, jobID, status string) error
- func MarkTrained(ctx context.Context, clientID, name string, trained, next int64) error
- func MergeEvents(ctx context.Context, exportID string) error
- func ModelKey(ctx context.Context, clientID, name string) *datastore.Key
- func PredictionKey(ctx context.Context, k string) *datastore.Key
- func PredictionKeyString(clientID, domain, entityID, revision string) string
- func ScheduleJob(ctx context.Context, queue, request string) error
- func StoreEvent(ctx context.Context, clientID string, event *api.Event) error
- func TrainModel(ctx context.Context, modelID string) error
- func TrainingJobKey(ctx context.Context, k string) *datastore.Key
- type TrainingInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizationKey ¶
AuthorizationKey key on collection AUTHORIZATIONS
func ClientResourceKey ¶
ClientResourceKey key on collection CLIENT_RESOURCES
func CreateClientAndAuthentication ¶
func CreateClientAndAuthentication(ctx context.Context, clientID, clientSecret, scope, token string) error
CreateClientAndAuthentication creates a new client and its authentication
func CreateDefaultExport ¶
CreateDefaultExport creates an initial export definition
func CreateDefaultModel ¶
CreateDefaultModel creates an initial model definition
func CreateExport ¶
CreateExport creates a new export definition
func ExportEvents ¶
ExportEvents exports events in time range ]start, end] and writes it to a csv file on Cloud Storage
func GetAuthorization ¶
GetAuthorization returns the authorization for the given token
func GetEvents ¶
func GetEvents(ctx context.Context, clientID, event string, start, end int64, page, limit int) (*[]types.EventDS, error)
GetEvents queries the events store for events of type event in the time range [start, end]
func GetPrediction ¶
func GetPrediction(ctx context.Context, clientID, name, id, entityType, targetEntityType string, limit int) (*api.Prediction, error)
GetPrediction returns a prediction based on a specified model
func ImportPredictions ¶
ImportPredictions imports the results of a training job
func InvokeFunction ¶
func InvokeFunction(ctx context.Context, function, reqID string, payload interface{}) (int, *types.GenericResponse)
InvokeFunction calls a Cloud Function and posts data to it
func MarkModelTrainingDone ¶
MarkModelTrainingDone writes an export record back to the datastore with updated metadata
func MarkTrained ¶
MarkTrained writes an export record back to the datastore with updated metadata
func MergeEvents ¶
MergeEvents merges all exported events for a model in a single file
func PredictionKey ¶
PredictionKey key on collection PREDICTIONS
func PredictionKeyString ¶
PredictionKeyString returns the composite key string for a prediction
func ScheduleJob ¶
ScheduleJob is a shorthand to create a background job
func StoreEvent ¶
StoreEvent stores an event in the datastore
func TrainModel ¶
TrainModel submits a model for training to Google ML
Types ¶
type TrainingInput ¶
type TrainingInput struct { // FIXME: make this a generic struct for a generic glue function! ScaleTier string `json:"scaleTier"` PackageURIs []string `json:"packageUris"` PythonModule string `json:"pythonModule"` Region string `json:"region"` JobDir string `json:"jobDir"` RuntimeVersion string `json:"runtimeVersion"` PythonVersion string `json:"pythonVersion"` ModelArguments []string `json:"args"` }
TrainingInput is used to submit a training job with Cloud ML