Send feedback
Class Model (7.3.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 7.3.0 keyboard_arrow_down
Model objects are returned by methods such as and .
Package
@google-cloud/bigquery
Example
const { BigQuery } = require ( '@google-cloud/bigquery' );
const bigquery = new BigQuery ();
const dataset = bigquery . dataset ( 'my-dataset' );
const model = dataset . model ( 'my-model' );
Constructors
(constructor)(dataset, id)
constructor ( dataset : Dataset , id : string );
Constructs a new instance of the Model
class
Parameters Name Description dataset
Dataset
id
string
Properties
bigQuery
dataset
Methods
createExtractJob ( destination : string | File , options ?: CreateExtractJobOptions ): Promise<JobResponse> ;
Example
const { BigQuery } = require ( '@google-cloud/bigquery' );
const bigquery = new BigQuery ();
const dataset = bigquery . dataset ( 'my-dataset' );
const model = dataset . model ( 'my-model' );
const extractedModel = 'gs://my-bucket/extracted-model' ;
function callback ( err , job , apiResponse ) {
// `job` is a Job object that can be used to check the status of the
// request .
}
//-
// To use the default options , just pass a string or a { @link
https :// googleapis . dev / nodejs / storage / latest / File . html File }
object .
//
// Note : The default format is 'ML_TF_SAVED_MODEL' .
//-
model . createExtractJob ( extractedModel , callback );
//-
// If you need more customization , pass an `options` object .
//-
const options = {
format : 'ML_TF_SAVED_MODEL' ,
jobId : '123abc'
} ;
model . createExtractJob ( extractedModel , options , callback );
//-
// If the callback is omitted , we 'll return a Promise.
//-
model.createExtractJob(extractedModel, options).then((data) => {
const job = data[0];
const apiResponse = data[1];
});
createExtractJob ( destination : string | File , options : CreateExtractJobOptions , callback : JobCallback ): void ;
Returns Type Description void
createExtractJob ( destination : string | File , callback : JobCallback ): void ;
Returns Type Description void
extract ( destination : string | File , options ?: CreateExtractJobOptions ): Promise<JobMetadataResponse> ;
Export model to Cloud Storage.
Example
const { BigQuery } = require ( '@google-cloud/bigquery' );
const bigquery = new BigQuery ();
const dataset = bigquery . dataset ( 'my-dataset' );
const model = dataset . model ( 'my-model' );
const extractedModel = 'gs://my-bucket/extracted-model' ;
//-
function callback ( err , job , apiResponse ) {
// `job` is a Job object that can be used to check the status of the
// request .
}
//-
// To use the default options , just pass a string or a { @link
https :// googleapis . dev / nodejs / storage / latest / File . html File }
object .
//
// Note : The default format is 'ML_TF_SAVED_MODEL' .
//-
model . createExtractJob ( extractedModel , callback );
//-
// If you need more customization , pass an `options` object .
//-
const options = {
format : 'ML_TF_SAVED_MODEL' ,
jobId : '123abc'
} ;
model . createExtractJob ( extractedModel , options , callback );
//-
// If the callback is omitted , we 'll return a Promise.
//-
model.createExtractJob(extractedModel, options).then((data) => {
const job = data[0];
const apiResponse = data[1];
});
extract ( destination : string | File , options : CreateExtractJobOptions , callback ?: JobMetadataCallback ): void ;
Returns Type Description void
extract ( destination : string | File , callback ?: JobMetadataCallback ): void ;
Returns Type Description void
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-06 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-06 UTC."],[],[]]