Documentation ¶
Overview ¶
Package prediction provides access to the Prediction API.
See https://developers.google.com/prediction/docs/developer-guide
Usage example:
import "github.com/zippoxer/google-api-go-client/prediction/v1.2" ... predictionService, err := prediction.New(oauthHttpClient)
Index ¶
- Constants
- type HostedmodelsPredictCall
- func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall
- func (c *HostedmodelsPredictCall) Do() (*Output, error)
- func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall
- func (c *HostedmodelsPredictCall) QuotaUser(quotaUser string) *HostedmodelsPredictCall
- func (c *HostedmodelsPredictCall) UserIP(userIP string) *HostedmodelsPredictCall
- type HostedmodelsService
- type Input
- type InputInput
- type Output
- type OutputOutputMulti
- type PredictCall
- type Service
- type Training
- type TrainingDeleteCall
- func (c *TrainingDeleteCall) Context(ctx context.Context) *TrainingDeleteCall
- func (c *TrainingDeleteCall) Do() error
- func (c *TrainingDeleteCall) Fields(s ...googleapi.Field) *TrainingDeleteCall
- func (c *TrainingDeleteCall) QuotaUser(quotaUser string) *TrainingDeleteCall
- func (c *TrainingDeleteCall) UserIP(userIP string) *TrainingDeleteCall
- type TrainingGetCall
- func (c *TrainingGetCall) Context(ctx context.Context) *TrainingGetCall
- func (c *TrainingGetCall) Do() (*Training, error)
- func (c *TrainingGetCall) Fields(s ...googleapi.Field) *TrainingGetCall
- func (c *TrainingGetCall) IfNoneMatch(entityTag string) *TrainingGetCall
- func (c *TrainingGetCall) QuotaUser(quotaUser string) *TrainingGetCall
- func (c *TrainingGetCall) UserIP(userIP string) *TrainingGetCall
- type TrainingInsertCall
- func (c *TrainingInsertCall) Context(ctx context.Context) *TrainingInsertCall
- func (c *TrainingInsertCall) Data(data string) *TrainingInsertCall
- func (c *TrainingInsertCall) Do() (*Training, error)
- func (c *TrainingInsertCall) Fields(s ...googleapi.Field) *TrainingInsertCall
- func (c *TrainingInsertCall) QuotaUser(quotaUser string) *TrainingInsertCall
- func (c *TrainingInsertCall) UserIP(userIP string) *TrainingInsertCall
- type TrainingModelInfo
- type TrainingService
- type TrainingUpdateCall
- func (c *TrainingUpdateCall) Context(ctx context.Context) *TrainingUpdateCall
- func (c *TrainingUpdateCall) Do() (*Training, error)
- func (c *TrainingUpdateCall) Fields(s ...googleapi.Field) *TrainingUpdateCall
- func (c *TrainingUpdateCall) QuotaUser(quotaUser string) *TrainingUpdateCall
- func (c *TrainingUpdateCall) UserIP(userIP string) *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.
func (*HostedmodelsPredictCall) QuotaUser ¶
func (c *HostedmodelsPredictCall) QuotaUser(quotaUser string) *HostedmodelsPredictCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*HostedmodelsPredictCall) UserIP ¶
func (c *HostedmodelsPredictCall) UserIP(userIP string) *HostedmodelsPredictCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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.
func (*PredictCall) QuotaUser ¶
func (c *PredictCall) QuotaUser(quotaUser string) *PredictCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*PredictCall) UserIP ¶
func (c *PredictCall) UserIP(userIP string) *PredictCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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.
func (*TrainingDeleteCall) QuotaUser ¶
func (c *TrainingDeleteCall) QuotaUser(quotaUser string) *TrainingDeleteCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*TrainingDeleteCall) UserIP ¶
func (c *TrainingDeleteCall) UserIP(userIP string) *TrainingDeleteCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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.
func (*TrainingGetCall) QuotaUser ¶
func (c *TrainingGetCall) QuotaUser(quotaUser string) *TrainingGetCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*TrainingGetCall) UserIP ¶
func (c *TrainingGetCall) UserIP(userIP string) *TrainingGetCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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.
func (*TrainingInsertCall) QuotaUser ¶
func (c *TrainingInsertCall) QuotaUser(quotaUser string) *TrainingInsertCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*TrainingInsertCall) UserIP ¶
func (c *TrainingInsertCall) UserIP(userIP string) *TrainingInsertCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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.
func (*TrainingUpdateCall) QuotaUser ¶
func (c *TrainingUpdateCall) QuotaUser(quotaUser string) *TrainingUpdateCall
QuotaUser sets the optional parameter "quotaUser": Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.
func (*TrainingUpdateCall) UserIP ¶
func (c *TrainingUpdateCall) UserIP(userIP string) *TrainingUpdateCall
UserIP sets the optional parameter "userIp": IP address of the site where the request originates. Use this if you want to enforce per-user limits.
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:"-"` }