Pipeline¶
In [ ]:
Pipeline(steps: list)
Creates a Pipeline object, sequentially applying a list of transformations and a final estimator. The intermediate steps must implement a transform method.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
steps | list | ❌ | List of (name, transform) tuples (implementing fit/transform) that are chained, in the order in which they are chained, with the last object an estimator. |
Attributes¶
After the object is created, all parameters become attributes. Additional attributes will be created when fitting the model:
| Name | Type | Description |
|---|---|---|
X | list | List of the predictors. |
y | str | [Only if the final estimator implements a predict method] Response column. |
test_relation | str | [Only if the final estimator implements a predict method] Relation to use to test the model. All model methods are abstractions that simplify the process. The testing relation will be used by the methods to evaluate the model. If empty, the training relation will be used instead. This attribute can be changed at any time. |
Methods¶
| Name | Description |
|---|---|
| drop | Drops all the Pipeline models from the Vertica DB. |
| fit [Supervised] or fit [Unsupervised] | Trains all the Pipeline models. |
| get_params | Returns parameters of the Pipeline models. |
| inverse_transform | [Only if the final estimator implements an inverse_transform method] Applies the inverse model transformation on a vDataFrame. |
| predict | [Only if the final estimator implements a predict method] Predicts using the input relation. |
| report | [Supervised] Computes a regression/classification report using multiple metrics to evaluate the model depending on its type. |
| score [Classifier] or score [Regressor] | [Supervised] Computes the model score. |
| set_params | Sets the Pipeline parameters. |
| transform | [Only if the final estimator implements a transform method] Applies the model on a vDataFrame. |
Example¶
In [9]:
from verticapy.learn.linear_model import LinearRegression
from verticapy.learn.preprocessing import StandardScaler
from verticapy.learn.pipeline import Pipeline
model = Pipeline([("WineStd", StandardScaler(name = "public.Std_winequality")),
("WineLR", LinearRegression(name = "public.LR_winequality"))])
model.drop()
display(model)
