Class Pipeline (2.30.0)

Pipeline(steps: typing.List[typing.Tuple[str, bigframes.ml.base.BaseEstimator]])

Pipeline of transforms with a final estimator.

Sequentially apply a list of transforms and a final estimator. Intermediate steps of the pipeline must be transforms. That is, they must implement fit and transform methods. The final estimator only needs to implement fit.

The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. This simplifies code and allows for deploying an estimator and preprocessing together, e.g. with Pipeline.to_gbq(...).

Methods

Pipeline

Pipeline(steps: typing.List[typing.Tuple[str, bigframes.ml.base.BaseEstimator]])

Pipeline of transforms with a final estimator.

Sequentially apply a list of transforms and a final estimator. Intermediate steps of the pipeline must be transforms. That is, they must implement fit and transform methods. The final estimator only needs to implement fit.

The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. This simplifies code and allows for deploying an estimator and preprocessing together, e.g. with Pipeline.to_gbq(...).

__init__

__init__(steps)

API documentation for __init__ method.

fit

fit(X, y=None)

Fit the model.

Fit all the transformers one after the other and transform the data. Finally, fit the transformed data using the final estimator.

Returns
Type Description
Pipeline Pipeline with fitted steps.

get_params

get_params(deep=True)

Get parameters for this estimator.

Parameter
Name Description
deep bool, default True

Default True. If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
Type Description
Dictionary A dictionary of parameter names mapped to their values.

predict

predict(X)

API documentation for predict method.

score

score(X, y=None)

API documentation for score method.

to_gbq

to_gbq(model_name, replace=False)

Save the pipeline to BigQuery.

Returns
Type Description
Pipeline Saved model(pipeline).