Google Cloud Artifact Types

Artifact types corresponding to Google Cloud Resources produced and consumed by GCPC components.

These artifact types can be used in your custom KFP SDK components similarly to other KFP SDK artifacts. If you wish to produce Google artifacts from your own components, it is recommended that you use Containerized Python Components. You should assign metadata to the Google artifacts according to the artifact’s schema (provided by each artifact’s .schema attribute).

Classes:

BQMLModel([name, uri, metadata])

An artifact representing a Google Cloud BQML Model resource.

BQTable([name, uri, metadata])

An artifact representing a Google Cloud BQ Table resource.

ClassificationMetrics([name, uri, metadata])

An artifact representing evaluation classification metrics.

ForecastingMetrics([name, uri, metadata])

An artifact representing evaluation forecasting metrics.

RegressionMetrics([name, uri, metadata])

An artifact representing evaluation regression metrics.

UnmanagedContainerModel([name, uri, metadata])

An artifact representing a Vertex AI unmanaged container model.

VertexBatchPredictionJob([name, uri, metadata])

An artifact representing a Vertex AI BatchPredictionJob resource.

VertexDataset([name, uri, metadata])

An artifact representing a Vertex AI Dataset resource.

VertexEndpoint([name, uri, metadata])

An artifact representing a Vertex AI Endpoint resource.

VertexModel([name, uri, metadata])

An artifact representing a Vertex AI Model resource.

class google_cloud_pipeline_components.types.artifact_types.BQMLModel(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Google Cloud BQML Model resource.

Methods:

create(name, project_id, dataset_id, model_id)

Create a BQMLModel artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, project_id: str, dataset_id: str, model_id: str) BQMLModel[source]

Create a BQMLModel artifact instance.

Parameters
name: str

The artifact name.

project_id: str

The ID of the project containing this model.

dataset_id: str

The ID of the dataset containing this model.

model_id: str

The ID of the model. For more details, see

https

//cloud.google.com/bigquery/docs/reference/rest/v2/models#ModelReference

schema = 'title: google.BQMLModel\ntype: object\nproperties:\n projectId:\n type: string\n datasetId:\n type: string\n modelId:\n type: string'
schema_title = 'google.BQMLModel'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.BQTable(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Google Cloud BQ Table resource.

Methods:

create(name, project_id, dataset_id, table_id)

Create a BQTable artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, project_id: str, dataset_id: str, table_id: str) BQTable[source]

Create a BQTable artifact instance.

Parameters
name: str

The artifact name.

project_id: str

The ID of the project containing this table.

dataset_id: str

The ID of the dataset containing this table.

table_id: str

The ID of the table. For more details, see

https

//cloud.google.com/bigquery/docs/reference/rest/v2/TableReference

schema = 'title: google.BQTable\ntype: object\nproperties:\n projectId:\n type: string\n datasetId:\n type: string\n tableId:\n type: string\n expirationTime:\n type: string'
schema_title = 'google.BQTable'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.ClassificationMetrics(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing evaluation classification metrics.

Methods:

create([name, recall, precision, f1_score, ...])

Create a ClassificationMetrics artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str = 'evaluation_metrics', recall: float | None = None, precision: float | None = None, f1_score: float | None = None, accuracy: float | None = None, au_prc: float | None = None, au_roc: float | None = None, log_loss: float | None = None) ClassificationMetrics[source]

Create a ClassificationMetrics artifact instance.

Parameters
recall: float | None = None

Recall (True Positive Rate) for the given confidence threshold.

precision: float | None = None

Precision for the given confidence threshold.

f1_score: float | None = None

The harmonic mean of recall and precision.

accuracy: float | None = None

Accuracy is the fraction of predictions given the correct label.

au_prc: float | None = None

The Area Under Precision-Recall Curve metric.

au_roc: float | None = None

The Area Under Receiver Operating Characteristic curve metric.

log_loss: float | None = None

The Log Loss metric.

schema = 'title: google.ClassificationMetrics\ntype: object\nproperties:\n aggregationType:\n type: string\n enum:\n - AGGREGATION_TYPE_UNSPECIFIED\n - MACRO_AVERAGE\n - MICRO_AVERAGE\n aggregationThreshold:\n type: number\n format: float\n recall:\n type: number\n format: float\n precision:\n type: number\n format: float\n f1_score:\n type: number\n format: float\n accuracy:\n type: number\n format: float\n auPrc:\n type: number\n format: float\n auRoc:\n type: number\n format: float\n logLoss:\n type: number\n format: float\n confusionMatrix:\n type: object\n properties:\n rows:\n type: array\n items:\n type: array\n items:\n type: integer\n format: int64\n annotationSpecs:\n type: array\n items:\n type: object\n properties:\n id:\n type: string\n displayName:\n type: string\n confidenceMetrics:\n type: array\n items:\n type: object\n properties:\n confidenceThreshold:\n type: number\n format: float\n recall:\n type: number\n format: float\n precision:\n type: number\n format: float\n f1Score:\n type: number\n format: float\n maxPredictions:\n type: integer\n format: int32\n falsePositiveRate:\n type: number\n format: float\n accuracy:\n type: number\n format: float\n truePositiveCount:\n type: integer\n format: int64\n falsePositiveCount:\n type: integer\n format: int64\n falseNegativeCount:\n type: integer\n format: int64\n trueNegativeCount:\n type: integer\n format: int64\n recallAt1:\n type: number\n format: float\n precisionAt1:\n type: number\n format: float\n falsePositiveRateAt1:\n type: number\n format: float\n f1ScoreAt1:\n type: number\n format: float\n confusionMatrix:\n type: object\n properties:\n rows:\n type: array\n items:\n type: array\n items:\n type: integer\n format: int64\n annotationSpecs:\n type: array\n items:\n type: object\n properties:\n id:\n type: string\n displayName:\n type: string'
schema_title = 'google.ClassificationMetrics'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.ForecastingMetrics(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing evaluation forecasting metrics.

Methods:

create([name, root_mean_squared_error, ...])

Create a ForecastingMetrics artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str = 'evaluation_metrics', root_mean_squared_error: float | None = None, mean_absolute_error: float | None = None, mean_absolute_percentage_error: float | None = None, r_squared: float | None = None, root_mean_squared_log_error: float | None = None, weighted_absolute_percentage_error: float | None = None, root_mean_squared_percentage_error: float | None = None, symmetric_mean_absolute_percentage_error: float | None = None) ForecastingMetrics[source]

Create a ForecastingMetrics artifact instance.

Parameters
root_mean_squared_error: float | None = None

Root Mean Squared Error (RMSE).

mean_absolute_error: float | None = None

Mean Absolute Error (MAE).

mean_absolute_percentage_error: float | None = None

Mean absolute percentage error.

r_squared: float | None = None

Coefficient of determination as Pearson correlation coefficient.

root_mean_squared_log_error: float | None = None

Root mean squared log error.

weighted_absolute_percentage_error: float | None = None

Weighted Absolute Percentage Error. Does not use weights, this is just what the metric is called. Undefined if actual values sum to zero. Will be very large if actual values sum to a very small number.

root_mean_squared_percentage_error: float | None = None

Root Mean Square Percentage Error. Square root of MSPE. Undefined/imaginary when MSPE is negative.

symmetric_mean_absolute_percentage_error: float | None = None

Symmetric Mean Absolute Percentage Error.

schema = 'title: google.ForecastingMetrics\ntype: object\nproperties:\n rootMeanSquaredError:\n type: number\n format: float\n meanAbsoluteError:\n type: number\n format: float\n meanAbsolutePercentageError:\n type: number\n format: float\n rSquared:\n type: number\n format: float\n rootMeanSquaredLogError:\n type: number\n format: float\n weightedAbsolutePercentageError:\n type: number\n format: float\n rootMeanSquaredPercentageError:\n type: number\n format: float\n symmetricMeanAbsolutePercentageError:\n type: number\n format: float\n quantileMetrics:\n type: array\n items:\n type: object\n properties:\n quantile:\n type: number\n format: double\n scaledPinballLoss:\n type: number\n format: float\n observedQuantile:\n type: number\n format: double'
schema_title = 'google.ForecastingMetrics'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.RegressionMetrics(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing evaluation regression metrics.

Methods:

create([name, root_mean_squared_error, ...])

Create a RegressionMetrics artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str = 'evaluation_metrics', root_mean_squared_error: float | None = None, mean_absolute_error: float | None = None, mean_absolute_percentage_error: float | None = None, r_squared: float | None = None, root_mean_squared_log_error: float | None = None) RegressionMetrics[source]

Create a RegressionMetrics artifact instance.

Parameters
root_mean_squared_error: float | None = None

Root Mean Squared Error (RMSE).

mean_absolute_error: float | None = None

Mean Absolute Error (MAE).

mean_absolute_percentage_error: float | None = None

Mean absolute percentage error.

r_squared: float | None = None

Coefficient of determination as Pearson correlation coefficient.

root_mean_squared_log_error: float | None = None

Root mean squared log error.

schema = 'title: google.RegressionMetrics\ntype: object\nproperties:\n rootMeanSquaredError:\n type: number\n format: float\n meanAbsoluteError:\n type: number\n format: float\n meanAbsolutePercentageError:\n type: number\n format: float\n rSquared:\n type: number\n format: float\n rootMeanSquaredLogError:\n type: number\n format: float'
schema_title = 'google.RegressionMetrics'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.UnmanagedContainerModel(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Vertex AI unmanaged container model.

Methods:

create(predict_schemata, container_spec)

Create a UnmanagedContainerModel artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(predict_schemata: dict, container_spec: dict) UnmanagedContainerModel[source]

Create a UnmanagedContainerModel artifact instance.

Parameters
predict_schemata: dict

Contains the schemata used in Model’s predictions and explanations via PredictionService.Predict, PredictionService.Explain and BatchPredictionJob. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/PredictSchemata

container_spec: dict

Specification of a container for serving predictions. Some fields in this message correspond to fields in the Kubernetes Container v1 core specification. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/ModelContainerSpec

schema = 'title: google.UnmanagedContainerModel\ntype: object\nproperties:\n predictSchemata:\n type: object\n properties:\n instanceSchemaUri:\n type: string\n parametersSchemaUri:\n type: string\n predictionSchemaUri:\n type: string\n containerSpec:\n type: object\n properties:\n imageUri:\n type: string\n command:\n type: array\n items:\n type: string\n args:\n type: array\n items:\n type: string\n env:\n type: array\n items:\n type: object\n properties:\n name:\n type: string\n value:\n type: string\n ports:\n type: array\n items:\n type: object\n properties:\n containerPort:\n type: integer\n predictRoute:\n type: string\n healthRoute:\n type: string'
schema_title = 'google.UnmanagedContainerModel'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.VertexBatchPredictionJob(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Vertex AI BatchPredictionJob resource.

Methods:

create(name, uri, job_resource_name[, ...])

Create a VertexBatchPredictionJob artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, uri: str, job_resource_name: str, bigquery_output_table: str | None = None, bigquery_output_dataset: str | None = None, gcs_output_directory: str | None = None) VertexBatchPredictionJob[source]

Create a VertexBatchPredictionJob artifact instance.

Parameters
name: str

The artifact name.

uri: str

the Vertex Batch Prediction resource uri, in a form of

https

//{service-endpoint}/v1/projects/{project}/locations/{location}/batchPredictionJobs/{batchPredictionJob}, where {service-endpoint} is one of the supported service endpoints at

https

//cloud.google.com/vertex-ai/docs/reference/rest#rest_endpoints

job_resource_name: str

The name of the batch prediction job resource, in a form of projects/{project}/locations/{location}/batchPredictionJobs/{batchPredictionJob}. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs/get

bigquery_output_table: str | None = None

The name of the BigQuery table created, in predictions_<timestamp> format, into which the prediction output is written. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#outputinfo

bigquery_output_dataset: str | None = None

The path of the BigQuery dataset created, in

bq

//projectId.bqDatasetId format, into which the prediction output is written. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#outputinfo

gcs_output_directory: str | None = None

The full path of the Cloud Storage directory created, into which the prediction output is written. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#outputinfo

schema = 'title: google.VertexBatchPredictionJob\ntype: object\nproperties:\n resourceName:\n type: string\n bigqueryOutputTable:\n type: string\n gcsOutputDirectory:\n type: string\n bigqueryOutputDataset:\n type: string'
schema_title = 'google.VertexBatchPredictionJob'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.VertexDataset(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Vertex AI Dataset resource.

Methods:

create(name, uri, dataset_resource_name)

Create a VertexDataset artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, uri: str, dataset_resource_name: str) VertexDataset[source]

Create a VertexDataset artifact instance.

Parameters
name: str

The artifact name.

uri: str

the Vertex Dataset resource uri, in a form of

https

//{service-endpoint}/v1/projects/{project}/locations/{location}/datasets/{datasets_name}, where {service-endpoint} is one of the supported service endpoints at

https

//cloud.google.com/vertex-ai/docs/reference/rest#rest_endpoints

dataset_resource_name: str

The name of the Dataset resource, in a form of projects/{project}/locations/{location}/datasets/{datasets_name}. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.datasets/get

schema = 'title: google.VertexDataset\ntype: object\nproperties:\n resourceName:\n type: string'
schema_title = 'google.VertexDataset'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.VertexEndpoint(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Vertex AI Endpoint resource.

Methods:

create(name, uri, endpoint_resource_name)

Create a VertexEndpoint artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, uri: str, endpoint_resource_name: str) VertexEndpoint[source]

Create a VertexEndpoint artifact instance.

Parameters
name: str

The artifact name.

uri: str

the Vertex Endpoint resource uri, in a form of

https

//{service-endpoint}/v1/projects/{project}/locations/{location}/endpoints/{endpoint}, where {service-endpoint} is one of the supported service endpoints at

https

//cloud.google.com/vertex-ai/docs/reference/rest#rest_endpoints

endpoint_resource_name: str

The name of the Endpoint resource, in a form of projects/{project}/locations/{location}/endpoints/{endpoint}. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints/get

schema = 'title: google.VertexEndpoint\ntype: object\nproperties:\n resourceName:\n type: string'
schema_title = 'google.VertexEndpoint'
schema_version = '0.0.1'
class google_cloud_pipeline_components.types.artifact_types.VertexModel(name: str | None = None, uri: str | None = None, metadata: dict | None = None)[source]

Bases: Artifact

An artifact representing a Vertex AI Model resource.

Methods:

create(name, uri, model_resource_name)

Create a VertexModel artifact instance.

Attributes:

schema

schema_title

schema_version

classmethod create(name: str, uri: str, model_resource_name: str) VertexModel[source]

Create a VertexModel artifact instance.

Parameters
name: str

The artifact name.

uri: str

the Vertex Model resource uri, in a form of

https

//{service-endpoint}/v1/projects/{project}/locations/{location}/models/{model}, where {service-endpoint} is one of the supported service endpoints at

https

//cloud.google.com/vertex-ai/docs/reference/rest#rest_endpoints

model_resource_name: str

The name of the Model resource, in a form of projects/{project}/locations/{location}/models/{model}. For more details, see

https

//cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.models/get

schema = 'title: google.VertexModel\ntype: object\nproperties:\n resourceName:\n type: string'
schema_title = 'google.VertexModel'
schema_version = '0.0.1'