prediction

package
v0.0.0-...-7ca0ba9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

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

View Source
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) Do

func (c *HostedmodelsPredictCall) Do() (*Output, error)

func (*HostedmodelsPredictCall) Fields

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

type InputInput

type InputInput struct {
	CsvInstance []interface{} `json:"csvInstance,omitempty"`
}

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

type OutputOutputMulti

type OutputOutputMulti struct {
	Label string `json:"label,omitempty"`

	Score float64 `json:"score,omitempty"`
}

type PredictCall

type PredictCall struct {
	// contains filtered or unexported fields
}

func (*PredictCall) Do

func (c *PredictCall) Do() (*Output, error)

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
}

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

type TrainingDeleteCall

type TrainingDeleteCall struct {
	// contains filtered or unexported fields
}

func (*TrainingDeleteCall) Do

func (c *TrainingDeleteCall) Do() error

func (*TrainingDeleteCall) Fields

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

func (c *TrainingGetCall) Do() (*Training, error)

func (*TrainingGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type TrainingInsertCall

type TrainingInsertCall struct {
	// contains filtered or unexported fields
}

func (*TrainingInsertCall) Data

Data sets the optional parameter "data": mybucket/mydata resource in Google Storage

func (*TrainingInsertCall) Do

func (c *TrainingInsertCall) Do() (*Training, error)

func (*TrainingInsertCall) Fields

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

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

func (c *TrainingUpdateCall) Do() (*Training, error)

func (*TrainingUpdateCall) Fields

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

Jump to

Keyboard shortcuts

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