Documentation ¶
Overview ¶
Package prediction provides access to the Prediction API.
See https://developers.google.com/prediction/docs/developer-guide
Usage example:
import "google.golang.org/api/prediction/v1.2" ... predictionService, err := prediction.New(oauthHttpClient)
Index ¶
- Constants
- type HostedmodelsPredictCall
- type HostedmodelsService
- type Input
- type InputInput
- type Output
- type OutputOutputMulti
- type PredictCall
- type Service
- type Training
- type TrainingDeleteCall
- type TrainingGetCall
- type TrainingInsertCall
- type TrainingModelInfo
- type TrainingService
- type TrainingUpdateCall
- type Update
Constants ¶
const ( // Manage your data and permissions in Google Cloud Storage DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" // View your data in Google Cloud Storage DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" // Manage your data in Google Cloud Storage DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" // Manage your data in the Google Prediction API PredictionScope = "https://www.googleapis.com/auth/prediction" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostedmodelsPredictCall ¶
type HostedmodelsPredictCall struct {
// contains filtered or unexported fields
}
func (*HostedmodelsPredictCall) Context ¶
func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*HostedmodelsPredictCall) Do ¶
func (c *HostedmodelsPredictCall) Do() (*Output, error)
Do executes the "prediction.hostedmodels.predict" call. Exactly one of *Output or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Output.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*HostedmodelsPredictCall) Fields ¶
func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type HostedmodelsService ¶
type HostedmodelsService struct {
// contains filtered or unexported fields
}
func NewHostedmodelsService ¶
func NewHostedmodelsService(s *Service) *HostedmodelsService
func (*HostedmodelsService) Predict ¶
func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall
Predict: Submit input and request an output against a hosted model
type Input ¶
type Input struct { Input *InputInput `json:"input,omitempty"` // ForceSendFields is a list of field names (e.g. "Input") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
func (*Input) MarshalJSON ¶
type InputInput ¶
type InputInput struct { CsvInstance []interface{} `json:"csvInstance,omitempty"` // ForceSendFields is a list of field names (e.g. "CsvInstance") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
func (*InputInput) MarshalJSON ¶
func (s *InputInput) MarshalJSON() ([]byte, error)
type Output ¶
type Output struct { Id string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` OutputLabel string `json:"outputLabel,omitempty"` OutputMulti []*OutputOutputMulti `json:"outputMulti,omitempty"` OutputValue float64 `json:"outputValue,omitempty"` SelfLink string `json:"selfLink,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
func (*Output) MarshalJSON ¶
type OutputOutputMulti ¶
type OutputOutputMulti struct { Label string `json:"label,omitempty"` Score float64 `json:"score,omitempty"` // ForceSendFields is a list of field names (e.g. "Label") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
func (*OutputOutputMulti) MarshalJSON ¶
func (s *OutputOutputMulti) MarshalJSON() ([]byte, error)
type PredictCall ¶
type PredictCall struct {
// contains filtered or unexported fields
}
func (*PredictCall) Context ¶
func (c *PredictCall) Context(ctx context.Context) *PredictCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*PredictCall) Do ¶
func (c *PredictCall) Do() (*Output, error)
Do executes the "prediction.predict" call. Exactly one of *Output or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Output.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*PredictCall) Fields ¶
func (c *PredictCall) Fields(s ...googleapi.Field) *PredictCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Hostedmodels *HostedmodelsService Training *TrainingService // contains filtered or unexported fields }
type Training ¶
type Training struct { Id string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` ModelInfo *TrainingModelInfo `json:"modelInfo,omitempty"` SelfLink string `json:"selfLink,omitempty"` TrainingStatus string `json:"trainingStatus,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }
func (*Training) MarshalJSON ¶
type TrainingDeleteCall ¶
type TrainingDeleteCall struct {
// contains filtered or unexported fields
}
func (*TrainingDeleteCall) Context ¶
func (c *TrainingDeleteCall) Context(ctx context.Context) *TrainingDeleteCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*TrainingDeleteCall) Do ¶
func (c *TrainingDeleteCall) Do() error
Do executes the "prediction.training.delete" call.
func (*TrainingDeleteCall) Fields ¶
func (c *TrainingDeleteCall) Fields(s ...googleapi.Field) *TrainingDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type TrainingGetCall ¶
type TrainingGetCall struct {
// contains filtered or unexported fields
}
func (*TrainingGetCall) Context ¶
func (c *TrainingGetCall) Context(ctx context.Context) *TrainingGetCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*TrainingGetCall) Do ¶
func (c *TrainingGetCall) Do() (*Training, error)
Do executes the "prediction.training.get" call. Exactly one of *Training or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Training.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*TrainingGetCall) Fields ¶
func (c *TrainingGetCall) Fields(s ...googleapi.Field) *TrainingGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*TrainingGetCall) IfNoneMatch ¶
func (c *TrainingGetCall) IfNoneMatch(entityTag string) *TrainingGetCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
type TrainingInsertCall ¶
type TrainingInsertCall struct {
// contains filtered or unexported fields
}
func (*TrainingInsertCall) Context ¶
func (c *TrainingInsertCall) Context(ctx context.Context) *TrainingInsertCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*TrainingInsertCall) Data ¶
func (c *TrainingInsertCall) Data(data string) *TrainingInsertCall
Data sets the optional parameter "data": mybucket/mydata resource in Google Storage
func (*TrainingInsertCall) Do ¶
func (c *TrainingInsertCall) Do() (*Training, error)
Do executes the "prediction.training.insert" call. Exactly one of *Training or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Training.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*TrainingInsertCall) Fields ¶
func (c *TrainingInsertCall) Fields(s ...googleapi.Field) *TrainingInsertCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type TrainingModelInfo ¶
type TrainingModelInfo struct { ClassificationAccuracy float64 `json:"classificationAccuracy,omitempty"` MeanSquaredError float64 `json:"meanSquaredError,omitempty"` ModelType string `json:"modelType,omitempty"` // ForceSendFields is a list of field names (e.g. // "ClassificationAccuracy") to unconditionally include in API requests. // By default, fields with empty values are omitted from API requests. // However, any non-pointer, non-interface field appearing in // ForceSendFields will be sent to the server regardless of whether the // field is empty or not. This may be used to include empty fields in // Patch requests. ForceSendFields []string `json:"-"` }
func (*TrainingModelInfo) MarshalJSON ¶
func (s *TrainingModelInfo) MarshalJSON() ([]byte, error)
type TrainingService ¶
type TrainingService struct {
// contains filtered or unexported fields
}
func NewTrainingService ¶
func NewTrainingService(s *Service) *TrainingService
func (*TrainingService) Delete ¶
func (r *TrainingService) Delete(data string) *TrainingDeleteCall
Delete: Delete a trained model
func (*TrainingService) Get ¶
func (r *TrainingService) Get(data string) *TrainingGetCall
Get: Check training status of your model
func (*TrainingService) Insert ¶
func (r *TrainingService) Insert(training *Training) *TrainingInsertCall
Insert: Begin training your model
func (*TrainingService) Update ¶
func (r *TrainingService) Update(data string, update *Update) *TrainingUpdateCall
Update: Add new data to a trained model
type TrainingUpdateCall ¶
type TrainingUpdateCall struct {
// contains filtered or unexported fields
}
func (*TrainingUpdateCall) Context ¶
func (c *TrainingUpdateCall) Context(ctx context.Context) *TrainingUpdateCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*TrainingUpdateCall) Do ¶
func (c *TrainingUpdateCall) Do() (*Training, error)
Do executes the "prediction.training.update" call. Exactly one of *Training or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Training.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*TrainingUpdateCall) Fields ¶
func (c *TrainingUpdateCall) Fields(s ...googleapi.Field) *TrainingUpdateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
type Update ¶
type Update struct { // ClassLabel: The true class label of this instance ClassLabel string `json:"classLabel,omitempty"` // CsvInstance: The input features for this instance CsvInstance []interface{} `json:"csvInstance,omitempty"` // ForceSendFields is a list of field names (e.g. "ClassLabel") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` }