UNPKG

googleapis

Version:
170 lines (169 loc) 6.94 kB
/** * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AxiosPromise } from 'axios'; import { GoogleApis } from '../..'; import { BodyResponseCallback, GlobalOptions, MethodOptions } from '../../lib/api'; /** * Prediction API * * Lets you access a cloud hosted machine learning service that makes it easy to * build smart apps * * @example * const google = require('googleapis'); * const prediction = google.prediction('v1.2'); * * @namespace prediction * @type {Function} * @version v1.2 * @variation v1.2 * @param {object=} options Options for Prediction */ export declare class Prediction { _options: GlobalOptions; google: GoogleApis; root: this; hostedmodels: Resource$Hostedmodels; training: Resource$Training; constructor(options: GlobalOptions, google: GoogleApis); getRoot(): this; /** * prediction.predict * @desc Submit data and request a prediction * @alias prediction.predict * @memberOf! prediction(v1.2) * * @param {object} params Parameters for request * @param {string} params.data mybucket%2Fmydata resource in Google Storage * @param {prediction(v1.2).Input} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ predict(params?: any, options?: MethodOptions): AxiosPromise<Schema$Output>; predict(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Output>, callback?: BodyResponseCallback<Schema$Output>): void; } export interface Schema$Input { input: any; } export interface Schema$Output { id: string; kind: string; outputLabel: string; outputMulti: any[]; outputValue: number; selfLink: string; } export interface Schema$Training { id: string; kind: string; modelInfo: any; selfLink: string; trainingStatus: string; } export interface Schema$Update { /** * The true class label of this instance */ classLabel: string; /** * The input features for this instance */ csvInstance: any[]; } export declare class Resource$Hostedmodels { root: Prediction; constructor(root: Prediction); getRoot(): Prediction; /** * prediction.hostedmodels.predict * @desc Submit input and request an output against a hosted model * @alias prediction.hostedmodels.predict * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.hostedModelName The name of a hosted model * @param {().Input} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ predict(params?: any, options?: MethodOptions): AxiosPromise<Schema$Output>; predict(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Output>, callback?: BodyResponseCallback<Schema$Output>): void; } export declare class Resource$Training { root: Prediction; constructor(root: Prediction); getRoot(): Prediction; /** * prediction.training.delete * @desc Delete a trained model * @alias prediction.training.delete * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.data mybucket/mydata resource in Google Storage * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ delete(params?: any, options?: MethodOptions): AxiosPromise<void>; delete(params?: any, options?: MethodOptions | BodyResponseCallback<void>, callback?: BodyResponseCallback<void>): void; /** * prediction.training.get * @desc Check training status of your model * @alias prediction.training.get * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.data mybucket/mydata resource in Google Storage * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get(params?: any, options?: MethodOptions): AxiosPromise<Schema$Training>; get(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Training>, callback?: BodyResponseCallback<Schema$Training>): void; /** * prediction.training.insert * @desc Begin training your model * @alias prediction.training.insert * @memberOf! () * * @param {object} params Parameters for request * @param {string=} params.data mybucket/mydata resource in Google Storage * @param {().Training} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ insert(params?: any, options?: MethodOptions): AxiosPromise<Schema$Training>; insert(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Training>, callback?: BodyResponseCallback<Schema$Training>): void; /** * prediction.training.update * @desc Add new data to a trained model * @alias prediction.training.update * @memberOf! () * * @param {object} params Parameters for request * @param {string} params.data mybucket/mydata resource in Google Storage * @param {().Update} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ update(params?: any, options?: MethodOptions): AxiosPromise<Schema$Training>; update(params?: any, options?: MethodOptions | BodyResponseCallback<Schema$Training>, callback?: BodyResponseCallback<Schema$Training>): void; }