prediction - ActiveState ActiveGo 1.8
...

Package prediction

import "google.golang.org/api/prediction/v1.2"
Overview
Index

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
    func (c *HostedmodelsPredictCall) Context(ctx context.Context) *HostedmodelsPredictCall
    func (c *HostedmodelsPredictCall) Do(opts ...googleapi.CallOption) (*Output, error)
    func (c *HostedmodelsPredictCall) Fields(s ...googleapi.Field) *HostedmodelsPredictCall
    func (c *HostedmodelsPredictCall) Header() http.Header
type HostedmodelsService
    func NewHostedmodelsService(s *Service) *HostedmodelsService
    func (r *HostedmodelsService) Predict(hostedModelName string, input *Input) *HostedmodelsPredictCall
type Input
    func (s *Input) MarshalJSON() ([]byte, error)
type InputInput
    func (s *InputInput) MarshalJSON() ([]byte, error)
type Output
    func (s *Output) MarshalJSON() ([]byte, error)
    func (s *Output) UnmarshalJSON(data []byte) error
type OutputOutputMulti
    func (s *OutputOutputMulti) MarshalJSON() ([]byte, error)
    func (s *OutputOutputMulti) UnmarshalJSON(data []byte) error
type PredictCall
    func (c *PredictCall) Context(ctx context.Context) *PredictCall
    func (c *PredictCall) Do(opts ...googleapi.CallOption) (*Output, error)
    func (c *PredictCall) Fields(s ...googleapi.Field) *PredictCall
    func (c *PredictCall) Header() http.Header
type Service
    func New(client *http.Client) (*Service, error)
    func (s *Service) Predict(data string, input *Input) *PredictCall
type Training
    func (s *Training) MarshalJSON() ([]byte, error)
type TrainingDeleteCall
    func (c *TrainingDeleteCall) Context(ctx context.Context) *TrainingDeleteCall
    func (c *TrainingDeleteCall) Do(opts ...googleapi.CallOption) error
    func (c *TrainingDeleteCall) Fields(s ...googleapi.Field) *TrainingDeleteCall
    func (c *TrainingDeleteCall) Header() http.Header
type TrainingGetCall
    func (c *TrainingGetCall) Context(ctx context.Context) *TrainingGetCall
    func (c *TrainingGetCall) Do(opts ...googleapi.CallOption) (*Training, error)
    func (c *TrainingGetCall) Fields(s ...googleapi.Field) *TrainingGetCall
    func (c *TrainingGetCall) Header() http.Header
    func (c *TrainingGetCall) IfNoneMatch(entityTag string) *TrainingGetCall
type TrainingInsertCall
    func (c *TrainingInsertCall) Context(ctx context.Context) *TrainingInsertCall
    func (c *TrainingInsertCall) Data(data string) *TrainingInsertCall
    func (c *TrainingInsertCall) Do(opts ...googleapi.CallOption) (*Training, error)
    func (c *TrainingInsertCall) Fields(s ...googleapi.Field) *TrainingInsertCall
    func (c *TrainingInsertCall) Header() http.Header
type TrainingModelInfo
    func (s *TrainingModelInfo) MarshalJSON() ([]byte, error)
    func (s *TrainingModelInfo) UnmarshalJSON(data []byte) error
type TrainingService
    func NewTrainingService(s *Service) *TrainingService
    func (r *TrainingService) Delete(data string) *TrainingDeleteCall
    func (r *TrainingService) Get(data string) *TrainingGetCall
    func (r *TrainingService) Insert(training *Training) *TrainingInsertCall
    func (r *TrainingService) Update(data string, update *Update) *TrainingUpdateCall
type TrainingUpdateCall
    func (c *TrainingUpdateCall) Context(ctx context.Context) *TrainingUpdateCall
    func (c *TrainingUpdateCall) Do(opts ...googleapi.CallOption) (*Training, error)
    func (c *TrainingUpdateCall) Fields(s ...googleapi.Field) *TrainingUpdateCall
    func (c *TrainingUpdateCall) Header() http.Header
type Update
    func (s *Update) MarshalJSON() ([]byte, error)

Package files

prediction-gen.go

Constants

OAuth2 scopes used by this API.

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"
)

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(opts ...googleapi.CallOption) (*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) Header

func (c *HostedmodelsPredictCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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:"-"`

    // NullFields is a list of field names (e.g. "Input") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

func (*Input) MarshalJSON

func (s *Input) MarshalJSON() ([]byte, error)

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:"-"`

    // NullFields is a list of field names (e.g. "CsvInstance") to include
    // in API requests with the JSON null value. By default, fields with
    // empty values are omitted from API requests. However, any field with
    // an empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []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:"-"`

    // NullFields is a list of field names (e.g. "Id") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

func (*Output) MarshalJSON

func (s *Output) MarshalJSON() ([]byte, error)

func (*Output) UnmarshalJSON

func (s *Output) UnmarshalJSON(data []byte) error

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:"-"`

    // NullFields is a list of field names (e.g. "Label") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

func (*OutputOutputMulti) MarshalJSON

func (s *OutputOutputMulti) MarshalJSON() ([]byte, error)

func (*OutputOutputMulti) UnmarshalJSON

func (s *OutputOutputMulti) UnmarshalJSON(data []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(opts ...googleapi.CallOption) (*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) Header

func (c *PredictCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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
}

func New

func New(client *http.Client) (*Service, error)

func (*Service) Predict

func (s *Service) Predict(data string, input *Input) *PredictCall

Predict: Submit data and request a prediction

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:"-"`

    // NullFields is a list of field names (e.g. "Id") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

func (*Training) MarshalJSON

func (s *Training) MarshalJSON() ([]byte, error)

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(opts ...googleapi.CallOption) 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) Header

func (c *TrainingDeleteCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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(opts ...googleapi.CallOption) (*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) Header

func (c *TrainingGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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(opts ...googleapi.CallOption) (*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) Header

func (c *TrainingInsertCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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:"-"`

    // NullFields is a list of field names (e.g. "ClassificationAccuracy")
    // to include in API requests with the JSON null value. By default,
    // fields with empty values are omitted from API requests. However, any
    // field with an empty value appearing in NullFields will be sent to the
    // server as null. It is an error if a field in this list has a
    // non-empty value. This may be used to include null fields in Patch
    // requests.
    NullFields []string `json:"-"`
}

func (*TrainingModelInfo) MarshalJSON

func (s *TrainingModelInfo) MarshalJSON() ([]byte, error)

func (*TrainingModelInfo) UnmarshalJSON

func (s *TrainingModelInfo) UnmarshalJSON(data []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(opts ...googleapi.CallOption) (*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) Header

func (c *TrainingUpdateCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

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:"-"`

    // NullFields is a list of field names (e.g. "ClassLabel") to include in
    // API requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

func (*Update) MarshalJSON

func (s *Update) MarshalJSON() ([]byte, error)